473,692 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Treeview Control, Process, and Focus

The following code creates 2 node objects in a treeview control. When
I click on the second node, a process object corectly launches
"http://www.cnn.com" but focus immediately returns to the treeview
control. It shouldn't. It should stay with the Internet Page. The Page
is being launched from the AfterSelect Event, could that be causing the
treeview control to get focus again?

Any help would be appreciated.

Thanks,

Elliot
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

Dim myproc As System.Diagnost ics.Process = new
system.Diagnost ics.Process()

TreeView1.Nodes .Add(New TreeNode("Inter net Sites"))
TreeView1.Nodes (0).Nodes.Add(N ew TreeNode("http://www.cnn.com"))

End Sub

Private Sub TreeView1_After Select(ByVal sender As System.Object, ByVal
e As System.Windows. Forms.TreeViewE ventArgs) Handles
TreeView1.After Select

myproc.StartInf o.WindowStyle = ProcessWindowSt yle.Normal

Try

myproc.Start(e. Node.Text)

Catch

End Try

End Sub

Nov 21 '05 #1
0 1140

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

Similar topics

0
2271
by: Plumer | last post by:
Hello everyone, Yesterday I posted a message about implementing drag & drop in a TreeView control. I'm having real difficulty getting this to work -- the process seems to be incredibly delicately balanced and finding my way through it has descended into one of those awful situations which I refer to as guess & test. From the point at which DoDragDrop() function is called until some later
3
1822
by: Dave | last post by:
I use the treeview to open a new form but the treeview reclaims focus after MouseUp. Any solutions to this problem?
2
1660
by: sindle | last post by:
I am using a treeview control and synchronizing the position in the treeview with a record on a subform (Each leaf node will point to a record in the subform). I've got that working fine. Now I want to do the following: If the user changes records in the subform, I want to position the focus of the treeview form to point to the correct node (essentially the reverse of the original problem). Any clue how to move the focus around in...
1
15542
by: Rasmus | last post by:
I need to grab focus to a specific node i my treeview when I click on my listbox. Here's the code that differs between the different event i the listBox: private void listBox1_SelectedIndexChanged(object sender, System.EventArgs e) { string selected; selected = this.listBox1.SelectedItem.ToString(); if(selected == "Error in Supercell 1") {
1
1185
by: iqbal | last post by:
Hi, I am writting an application in outlook style which has Left Panel and a Right Panel. I have Treeview COntrol in left panel, and I load the forms in right panel on AfterSelect event of the treeview. I am coming across 2 problems: 1) Forms event "Activated" does not trigger. Even when I force the event using f1.Activate, it does not execute the code inside the event.
1
6355
by: mongphong28 | last post by:
Hi, I'm using a treeview as a menu, and when the user clicks on a node I want the focus to set to a control (ie textbox) in a panel to the right. The problem I'm having is the focus will not stay on the control, but instead jumps back to the treeview. I'm setting the focus in the AfterSelect event of the treeview, and if I step through the code the desired control does have .Focused = True after I have set it, but then somewhere after...
18
15369
by: =?Utf-8?B?TGkgV2VuZw==?= | last post by:
Hi, Is there a way for TreeView to have multiple selections? But I am not talking about its checked boxes. I want a way similar to ListView with MultiSelect = True. So I can use or key and click to make multiple selections. Then when I simply click one item, all previous selections are gone. Thanks in advance.
1
4399
by: =?Utf-8?B?TG9yZW4=?= | last post by:
I’m having a couple of problems using the TreeView control on a windows form. I feel as if I’m missing something very obvious, but I not seeing it! Any suggestions would be appreciated. 1. I’d like to change the background color of the selected treeview node. To do this it looks as if I need to change the treeview’s SelectedNodeStyle property. MSDN states that “this property is read-only; however, you can set the properties...
3
6043
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
I have a TreeView control that I am populating with a lot of data. I have been asked to expand the nodes so management can quickly access the individual elements. This is easy to do with TreeView1.ExpandAll(); however, the TreeView control scrolls the last part of the data into focus. How do I either prevent this scrolling or reset the TreeView control's view?
0
8604
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8538
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9083
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...
0
8961
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8800
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6459
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
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1957
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.