473,499 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tree View

CAM
Hello,

I am using Visual Basic.Net 2008 and in my main menu form I have a tree view
in one of the child node I have a code that opens another form.

Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect

If e.Node.Name = "NodeUnassigned" Then

frmUnassigned.Show()

ElseIf e.Node.Name = "NodeDailyReports" Then

frmDailyReports.Show()
End If

Now the form "NodeUnassigned" and "NodeDailyReports" when pressed does show
the form, but soon as the form opens the "Main Menu" form appears I really
want to close the Main Menu form. How can I stop the "Main Menu" open up
again I just want to open the other form and close the Main Menu form? Does
anybody knows the code? Thank you in advance.

Nov 5 '08 #1
1 1946
On Nov 5, 7:17*am, "CAM" <alex_marti...@ca.rr.comwrote:
Hello,

I am using Visual Basic.Net 2008 and in my main menu form I have a tree view
in one of the child node I have a code that opens another form.

Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect

* * * * If e.Node.Name = "NodeUnassigned" Then

* * * * * * frmUnassigned.Show()

* * * * ElseIf e.Node.Name = "NodeDailyReports" Then

* * * * * * frmDailyReports.Show()
* * * * End If

Now the form "NodeUnassigned" and "NodeDailyReports" when pressed does show
the form, but soon as the form opens the "Main Menu" form appears I really
want to close the Main Menu form. *How can I stop the "Main Menu" open up
again I just want to open the other form and close the Main Menu form? *Does
anybody knows the code? *Thank you in advance.
You didn't include why and how you open "Main Menu" form, however as
you want to close Main Menu form when it's opened, so you can loop
through OpenForms property to determine when the form is opened, then
use Close() method to close it.

Again, it's not apparent when and where you want to close it from,
then use it carefully when you really need to close form because you
may need it at any time, so another choice would be Hide() method in
some cases.

http://msdn.microsoft.com/en-us/libr...openforms.aspx
http://www.experts-exchange.com/Prog..._23751235.html

Hope this helps,

Onur Güzel
Nov 5 '08 #2

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

Similar topics

3
10799
by: imani_technology_spam | last post by:
We need to present hierarchical data on a web page, the same way the tree view shows files in Windows Explorer. Here's the catch: that tree view needs to be bound to a SQL Server database. How...
0
2156
by: Tree menu using XML | last post by:
I have one XML file that has nodes and sub node and each and every node has the attribute call visible if its value is true then diplay this node else don't display thid node, but this condition i...
1
4891
by: Jesper DK | last post by:
Hi, I have docked a tree view to the left on a form. When I start to populate this tree view with nodes, a horizontal scroll box appears in the bottom of the tree view even though thee tree...
3
6043
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
1
2164
by: Kaye | last post by:
It seems that when I dynamically resize items in a tree-view control, using TVM_SETITEM and the TVITEMEX iIntegral member, things go awry. The window draws properly, but it seems like the RECTs for...
10
2498
by: dwok | last post by:
Does anyone know of a good article that discusses creating a "Tree View" control in ASP.NET? Or perhaps a Tree View Control that comes with source code? I have come across a lot of tree controls...
0
1408
by: rinishrk | last post by:
Hi, I have a web application that contains subfolders Admin and User with related webpages inside them. Within the Admin folder I have a page containing a Tree View Control.I want this tree view...
3
2362
by: gmail | last post by:
Hi Friends, Can any body suggest me on this. I am working on .NET 2005 Frame work 2.0 . I am facing problem using the tree stucture. I created the site map.Now i want use the site map in every...
1
4737
by: BeginingOfLife | last post by:
i am using a java script to create a tree view in my html page. i got that script from this link : http://destroydrop.com/javascripts/tree/ given script is static script creations for tree...
1
2601
by: happy.john1234 | last post by:
Hi, i have got large xml file which i have to show in tree view windows form.I tried with loading all those data at once to tree view but it took a long time to render that tree view.Now i am...
0
7007
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
7171
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,...
1
6893
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
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4918
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...
0
3098
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...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
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...

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.