473,793 Members | 2,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VS 2005 Beta 2: Using TreeView control in SplitContainer to change the right panel

I have a TreeView control in the left panel of a SplitContainer. When I
click on various nodes in the TreeView I would like different sets of
buttons and textboxes to appear in the right panel. Is this doable?

Also, it seems that the TreeView nodes do not have a click event. Is that
correct?

Thanks,
J.S.

--
Nov 17 '05 #1
6 3082
J.S.,

Yes, it is possible. The easiest way to do this would be to have the
different categories of controls laid out on panels which you set the
visibility of when the node is clicked.

In .NET 2.0 (which you are using), the TreeView class has the
NodeMouseClick event, which will give you the node that was clicked.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"J.S." <js*@nospam.com > wrote in message
news:eq******** ******@TK2MSFTN GP12.phx.gbl...
I have a TreeView control in the left panel of a SplitContainer. When I
click on various nodes in the TreeView I would like different sets of
buttons and textboxes to appear in the right panel. Is this doable?

Also, it seems that the TreeView nodes do not have a click event. Is that
correct?

Thanks,
J.S.

--

Nov 17 '05 #2
Hi Nicholas,
Yes, it is possible. The easiest way to do this would be to have the
different categories of controls laid out on panels which you set the
visibility of when the node is clicked.
That should work for a few controls but it might be a problem if there are
dozens of TreeView nodes with each having several corresponding buttons,
textboxes, and comboboxes that need to be shown in the right panel.

I am looking to do something similar to what one can do with frames in a web
page. Can a Main Form have sub-forms such that clicking on Node1 in the
left panel would show subform1 in the right panel and Node2, subform2 and so
on?

I sort of managed to do perform the same functions by using tabcontrols
instead of treeview but I would prefer the latter option.
In .NET 2.0 (which you are using), the TreeView class has the
NodeMouseClick event, which will give you the node that was clicked.


Thanks!

J.S.

--
Nov 17 '05 #3
J.S.,

You can't do it with sub forms, but you can do it with panels. Just
slap all of the controls you need on separate panels, and then show/hide the
panels according to which node is clicked.

I assume you want forms so that you can use separate design surfaces for
each node. You can create a custom user control, and it will pretty much
give you the same thing.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"J.S." <js*@nospam.com > wrote in message
news:ek******** ******@TK2MSFTN GP12.phx.gbl...
Hi Nicholas,
Yes, it is possible. The easiest way to do this would be to have the
different categories of controls laid out on panels which you set the
visibility of when the node is clicked.


That should work for a few controls but it might be a problem if there are
dozens of TreeView nodes with each having several corresponding buttons,
textboxes, and comboboxes that need to be shown in the right panel.

I am looking to do something similar to what one can do with frames in a
web page. Can a Main Form have sub-forms such that clicking on Node1 in
the left panel would show subform1 in the right panel and Node2, subform2
and so on?

I sort of managed to do perform the same functions by using tabcontrols
instead of treeview but I would prefer the latter option.
In .NET 2.0 (which you are using), the TreeView class has the
NodeMouseClick event, which will give you the node that was clicked.


Thanks!

J.S.

--

Nov 17 '05 #4
Thanks, Nicholas! That's just what I was looking for.

J.S.

--

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:uu******** ******@TK2MSFTN GP09.phx.gbl...
J.S.,

You can't do it with sub forms, but you can do it with panels. Just
slap all of the controls you need on separate panels, and then show/hide
the panels according to which node is clicked.

I assume you want forms so that you can use separate design surfaces
for each node. You can create a custom user control, and it will pretty
much give you the same thing.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

Nov 17 '05 #5
> slap all of the controls you need on separate panels, and then show/hide
the panels according to which node is clicked.
Nicholas, I thought the panels were just part of the SplitContainer and that
there was no separate panels control. However, your post seems to indicate
that one can have several panels, one of each node in the treeview control.
Or are you just referring to panels in the sense of groups of controls
programmtically grouped together to be hidden/shown based on the selection
of nodes in the treeview?
I assume you want forms so that you can use separate design surfaces
for each node. You can create a custom user control, and it will pretty
much give you the same thing.


Yes, that is exactly what I want to do. My left panel has dozens of nodes
in a treeview and in the right panel I'd like to show separate design
surfaces. I read somewhere that the listcontrol could be used in the right
panel but it doesn't seem to be the right control to show the kind of design
elements I need to show in the right panel.

Thanks,
J.S.
Nov 17 '05 #6
> slap all of the controls you need on separate panels, and then show/hide
the panels according to which node is clicked.
Nicholas, I thought the panels were just part of the SplitContainer and that
there was no separate panels control. However, your post seems to indicate
that one can have several panels, one of each node in the treeview control.
Or are you just referring to panels in the sense of groups of controls
programmtically grouped together to be hidden/shown based on the selection
of nodes in the treeview?
I assume you want forms so that you can use separate design surfaces
for each node. You can create a custom user control, and it will pretty
much give you the same thing.


Yes, that is exactly what I want to do. My left panel has dozens of nodes
in a treeview and in the right panel I'd like to show separate design
surfaces. I read somewhere that the listcontrol could be used in the right
panel but it doesn't seem to be the right control to show the kind of design
elements I need to show in the right panel.

Thanks,
J.S.
Nov 17 '05 #7

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

Similar topics

3
8841
by: Steve Richter | last post by:
in windows explorer, the nodes immed under the "my computer" root node appear with a minimum of indenting ( the +/- square is directly underneath the root node ). In the .NET TreeView control the indent is shifted one more indent level to the right, wasting valuable horizontal space. How can I instruct TreeView to indent from the root node the same way as windows explorer does? thanks,
2
1549
by: John Salerno | last post by:
I followed some simple steps in a magazine to create a Form with a split view, but it doesn't look right. First I added a ListView control and docked it to the left, then I added the Splitter control, then I added a TreeView and docked it with fill. When I run the window, it shows a big grey area in the center of the form and I can resize the right edge of it. How can I make it so that there is only a single line that can be used to...
4
1397
by: Brad | last post by:
I have a form where I have a treeview control in the left sidebar and then a panel next to it in the other pane. Based on user selection from the tree view, I would like the panel to display a certain html page that was created in Word as html. Currently I do have the treeview's nodes pointing to a URL, however for design asthetics, I would love to have the html page just open in this panel. How would I got about doing this and thanks...
10
1676
by: Dean Slindee | last post by:
Does anybody know to whom I can send this letter so that it hits home before Visual Studio 2005 goes production? Dear Microsoft Visual Studio 2005 developers, This is a request for you to change four of the most basic controls to improve them and make them more consistent amongst themselves.
2
2545
by: Bob | last post by:
I've got a MultiView with multiple Views. In one View, I want to display a Treeview on the left side and controls generated via a Placeholder control on the right side. If I drag a treeview control into the view it is on the left side. Then I drag a Placeholder control and it is positioned below the Treeview control. Why is that?
6
2646
by: Pucca | last post by:
My container with 2 panels containning Treeveiw and Listview controls are chopped off on the top by the toolstripmenu when I dock the these 2 contols in the parent container and the container is also docked to the parent, and the container at this poit enlarges and covers up the toolstripmenu. If I don't dock them then they don't resize when the form/container gets resize by the user. I have a toolcontianer with menustrip and toolstrip. ...
0
1440
by: Didier Bolf | last post by:
hello I use the framework2.0 When you have a Form which contains a usercontroll which contains a splitcontainer which contains a TreeView in the left panel of the splitcontainer. Then when the text of a treenode is too long for the width of the left panel of the splitcontainer, a tooltip
2
6230
by: Doc John | last post by:
We developed a Win application that basically consists of an Mdi Form and several child Forms. Now we want to change its appearance so that it has an Outlook-like appearance: it would have a panel on the left with several buttons, and when I press those buttons the individual Forms would open up on the right panel. How difficult would this transition be? I've added a splitContainer to my Mdi Form, but I'm not sure how to display a Child...
0
1797
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
I have a treeview setup on my page. In case it is relevant, it is set in an accordion, which is inside an update panel. When I click the treeview node, a page loads on the right side of my browser as it should. When I click the same node, the right side of my browser goes blank. I do not want it to go blank if the user clicks the same node. I would like it to not change. At this point, I do not know how it is happening. Is there a property...
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10430
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.