Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Components & Controls > Listviews / Treeviews

Listviews / Treeviews Anything related to listview and treeview components

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-29-2009, 10:53 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jun 2009
Age: 20
Posts: 4
Reputation: 0
twittumz is on a distinguished programming path ahead
Default tree view

How would i go about making right click select a node as well as left click then bring up a context menu with the selected node?

this is what i got now but i don't like how it acts.
Code:
private sub treeview1_AfterSelect(ByVal sender as System.Object, ByVal e as system.windows.forms.treevieweventargs) handles treeview1.AfterSelect
ctextmenu.clear
if treeview1.selectednode.text = treeview1.topnode.text then exit sub
ctextmenu.add(treeview1.selectednode.text)
end sub

Last edited by twittumz; 06-30-2009 at 8:14 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-29-2009, 11:08 PM
jmcilhinney's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Aug 2004
Location: Sydney, Australia
Age: 40
Posts: 6,102
Reputation: 541
jmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalistjmcilhinney VB.NET gold medalist
Default

You would handle the MouseDown event and call the GetNodeAt method to find the node that was clicked, then make that the SelectedNode.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-30-2009, 8:16 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jun 2009
Age: 20
Posts: 4
Reputation: 0
twittumz is on a distinguished programming path ahead
Default

Alright thanks; ill give that a go.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 2:12 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.