|
-
Sep 12th, 2002, 11:53 AM
#1
Thread Starter
Hyperactive Member
treeview context menu
Hello.. I have a treeview that has an associated context menu.. When i right click on the treeview, the menu pops up.. correct!! however, if i right click on an element in the treeview that is currently not selected, it gets highlighted but the treeview still indicates that the .selectednode is the one that was previously highlighted...
it sounds like the selectitem event is not finishing before the contextmenu popup event fires..
any suggestions?
thanks
-Matt
[vbcode]
'*****************************
MsgBox "MCD :: [email protected]", vbInformation + vbOKOnly, "User"
'*****************************
[/vbcode]
-
Sep 12th, 2002, 11:53 AM
#2
Thread Starter
Hyperactive Member
also..
is there an property that I can use to get the currently highlighted element instead of the selected one?
thanks
-mcd
[vbcode]
'*****************************
MsgBox "MCD :: [email protected]", vbInformation + vbOKOnly, "User"
'*****************************
[/vbcode]
-
Sep 12th, 2002, 12:00 PM
#3
Thread Starter
Hyperactive Member
Ok.. i found the same issue on this threat: http://www.dotnet247.com/247referenc...25/129525.aspx
I used their solution and it works.. now the question is, is this a flaw in the framework? If so, will it be fixed?
Thanks,
-mcd
[vbcode]
'*****************************
MsgBox "MCD :: [email protected]", vbInformation + vbOKOnly, "User"
'*****************************
[/vbcode]
-
Sep 12th, 2002, 06:40 PM
#4
Member
-
Sep 12th, 2002, 08:24 PM
#5
Thread Starter
Hyperactive Member
Vahid... thanks for the reply.. Actually, on that link I provided, there is an easy way to do this with the context menu linked directly to the treeview:
VB Code:
Private Sub tvwFields_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles tvwFields.MouseDown
If e.Button = MouseButtons.Right Then tvwFields.SelectedNode =
tvwFields.GetNodeAt(New Point(e.X, e.Y))
End Sub
This works pretty good.. It just changes the selected node to the one you rightclicked on, then the context menu fires
thanks,
-matt
[vbcode]
'*****************************
MsgBox "MCD :: [email protected]", vbInformation + vbOKOnly, "User"
'*****************************
[/vbcode]
-
Sep 12th, 2002, 10:39 PM
#6
yay gay
i remember programming in vb6 and that error also happened a lot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|