Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Mon, 23 Jun 2008 03:38:08 +0200,    group: microsoft.public.dotnet.framework.windowsforms.controls        back       


Can't derive from System.Windows.Forms.TreeView   
Hi,

I'd like to create a specialized version of System.Windows.Forms.TreeView. But creating a class and deriving from TreeView doesn't work. I can't drag this new class onto a Form or store it in the Toolbox.

What am I doing wrong here? How can I derive from TreeView and have all the Visual Studio Designer features?

TIA,
Axel Dahmen
date: Mon, 23 Jun 2008 03:38:08 +0200   author:   Axel Dahmen am

Re: Can't derive from System.Windows.Forms.TreeView   
On Mon, 23 Jun 2008 03:38:08 +0200, "Axel Dahmen"
<keentoknow@newsgroup.nospam> wrote:

>Hi,
>
>I'd like to create a specialized version of System.Windows.Forms.TreeView. But creating a class and deriving from TreeView doesn't work. I can't drag this new class onto a Form or store it in the Toolbox.
>
>What am I doing wrong here? How can I derive from TreeView and have all the Visual Studio Designer features?
>
>TIA,
>Axel Dahmen

Create a new UserControl class.  Change the inheritance from
UserControl to TreeView (if using VS2005 or later this is in the
.designer file).  You will have to comment out or remove one line in
the generated code that will give an error once you change the class.
date: Sun, 22 Jun 2008 21:41:24 -0700   author:   Jack Jackson

RE: Can't derive from System.Windows.Forms.TreeView   
Hi Axel,

You can create your own TreeView easily, but it may not always pop up in the 
ToolBox, especially if you have lot of third party controls already in the 
ToolBox.

Make sure Tools->Windows Forms Designer->General->Autopopulate ToolBox is 
set to true (remember to restart the solution if you change the setting).  If 
you still have problems seeing the control (PS! controls should be in the 
toolbox in a group called "<project> components") you may have to add a 
regular TreeView and change the class in the designer.cs file.

Its a bit unclear what you mean by "I can't drag this new class onto a Form 
or store it in the Toolbox." Can you elaborate?

-- 
Happy Coding!
Morten Wennevik [C# MVP]


"Axel Dahmen" wrote:

> Hi,
> 
> I'd like to create a specialized version of System.Windows.Forms.TreeView.
> But creating a class and deriving from TreeView doesn't work. I can't drag
> this new class onto a Form or store it in the Toolbox.
> 
> What am I doing wrong here? How can I derive from TreeView and have all
> the Visual Studio Designer features?
> 
> TIA,
> Axel Dahmen
>
date: Sun, 22 Jun 2008 22:46:00 -0700   author:   Morten Wennevik [C# MVP]

Re: Can't derive from System.Windows.Forms.TreeView   
Thanks, Jack and Morten!

Going through your tips I've found the reason why it didn't work yesterday. I forgot to declare my class as "public"....

I found your tips - particularly the "toolbox group called <project> components tip - very valuable.

Thanks a lot! And best regards,
Axel Dahmen



--------------------------------
"Morten Wennevik [C# MVP]"  schrieb im Newsbeitrag news:E1C54307-C45A-46F4-A82A-2D01E3F1F2E0@microsoft.com...
> Hi Axel,
> 
> You can create your own TreeView easily, but it may not always pop up in the 
> ToolBox, especially if you have lot of third party controls already in the 
> ToolBox.
> 
> Make sure Tools->Windows Forms Designer->General->Autopopulate ToolBox is 
> set to true (remember to restart the solution if you change the setting).  If 
> you still have problems seeing the control (PS! controls should be in the 
> toolbox in a group called "<project> components") you may have to add a 
> regular TreeView and change the class in the designer.cs file.
> 
> Its a bit unclear what you mean by "I can't drag this new class onto a Form 
> or store it in the Toolbox." Can you elaborate?
> 
> -- 
> Happy Coding!
> Morten Wennevik [C# MVP]
> 
> 
> "Axel Dahmen" wrote:
> 
>> Hi,
>> 
>> I'd like to create a specialized version of System.Windows.Forms.TreeView.
>> But creating a class and deriving from TreeView doesn't work. I can't drag
>> this new class onto a Form or store it in the Toolbox.
>> 
>> What am I doing wrong here? How can I derive from TreeView and have all
>> the Visual Studio Designer features?
>> 
>> TIA,
>> Axel Dahmen
>>
date: Tue, 24 Jun 2008 01:39:19 +0200   author:   Axel Dahmen am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us