473,782 Members | 2,423 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 1145

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

Similar topics

0
2279
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
1827
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
1662
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
15551
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
1189
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
6371
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
15379
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
4406
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
6049
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
9480
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
10147
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...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
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
6735
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
5378
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...
1
4044
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
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
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.