473,320 Members | 2,112 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,320 software developers and data experts.

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 1939
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
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
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
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
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
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
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
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
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
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
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
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.