473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

treeview hosting a combobox ?

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
Jul 21 '05 #1
1 5048
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" <jm******@hotmail.com> wrote in message
news:df**************************@posting.google.c om...
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jurjen de Groot | last post by:
I'm trying to get the TreeView control from the Microsoft.Web.UI.WebControls namespace to work but for some reason it won't render correctly. I've found some webpages on the MSDN site about this...
0
by: MarkD | last post by:
I have an ASP.NET (VB.NET) application that calls all VB6 COM DLL via Interop. The DLL uses functionality contained in a Custom OCX Control (Also VB6) that in turn contains a standard TreeView...
0
by: Ben Coats | last post by:
Hey I'm trying to find code for an Explorer-style Directory ComboBox. (You know, it display "Desktop", "My Computer", all drives, etc., but it has a treeview control inside the combobox so that you...
4
by: Ben Coats | last post by:
Hey, I'm trying to find code for an Explorer-style Directory ComboBox. (You know, it display "Desktop", "My Computer", all drives, etc., but it has a treeview control inside the combobox so that...
11
by: Timo Kunze | last post by:
Hi! If you move the mouse over an item that's part of a treeview and wider than the treeview, a tooltip showing the full item text will be displayed. I try to do this for ListBoxes and...
1
by: Jeff MacDuff | last post by:
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...
0
by: Sagaert Johan | last post by:
Hi How can i create a treeNode that contains also a Combobox. I Added a combobox to the treeview controls collection, but when i scroll the treeview, the combobox stays at its location. I...
2
by: dexz | last post by:
Hi Using the following code I defined that when Im loading the Announcements into the program it marks the some of them with various icons in the TreeView. This was fairly easy, because when I...
3
by: ippo | last post by:
Hi all, I have a silly problem with treeview. I'm using .NET 2.0. I need to set the two properties treeNodeSrc - treeNodeTypeSrc at run time using C#, but in the treeViews that I define, these two...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.