PC Review


Reply
Thread Tools Rate Thread

treeview hosting a combobox ?

 
 
Jeff MacDuff
Guest
Posts: n/a
 
      16th Sep 2003
I am trying to create a treeview in .net which isnt a problem, however
I want the treeview to be able to contain combo boxes instead of just
strings.

Windows XP already does this in the printer dialog like this:
http://www.madhaxor.com/misc/sample.jpg

How can I do this in C# / .Net ?

Thanks!
Jeff
 
Reply With Quote
 
 
 
 
Harald Bjorøy
Guest
Posts: n/a
 
      18th Sep 2003
You can start by doing someting like:
private void treeView1_AfterSelect(object sender,
System.Windows.Forms.TreeViewEventArgs e)

{

TreeView t=(TreeView)sender;

theCombo.Top=e.Node.Bounds.Top+t.Top;

theCombo.Left=e.Node.Bounds.Right+10+t.Left;

}

Where "theCombo" is a combo you have dropped on the form. You could of
course create this in code without dropping it on.

You would also want to add code to copy the data to/from the combo, and to
edit the label of the combo after the change.

The combo needs to be hidden when the wrong node-type is selected (or no
node is selected) - all needed info should be in the "e"-object above, or in
the TreeView itself.

Regards,
Harald Bjorøy
www.ulriken-consulting.no


"Jeff MacDuff" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am trying to create a treeview in .net which isnt a problem, however
> I want the treeview to be able to contain combo boxes instead of just
> strings.
>
> Windows XP already does this in the printer dialog like this:
> http://www.madhaxor.com/misc/sample.jpg
>
> How can I do this in C# / .Net ?
>
> Thanks!
> Jeff



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Hosting, Reseller Hosting, and Dedicated Hosting!!!!!! teo1991 Microsoft Access 0 2nd Apr 2009 02:59 PM
Web Hosting, Reseller Hosting, and Dedicated Hosting!!!!!! ufi02 Microsoft Excel Discussion 0 28th Mar 2009 02:25 PM
Web Hosting, Reseller Hosting, and Dedicated Hosting!!!!!! ufi02 Microsoft ASP .NET 0 27th Mar 2009 08:49 PM
Web Hosting, Reseller Hosting, and Dedicated Hosting!!!!!! ufi02 Microsoft Excel Worksheet Functions 0 27th Mar 2009 08:22 PM
Web Hosting, Reseller Hosting, and Dedicated Hosting!!!!!! ufi02 Microsoft C# .NET 0 27th Mar 2009 08:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:22 PM.