Pop-ups in TreeView 
Author Message
 Pop-ups in TreeView

Quote:

> I am having problems trying to get a pop-up to behave correctly for a
> treeview. When the right mouse button is clicked, I want the current node to
> be selected and the pop-up to display. When the left button is clicked, the
> normal treeview behavior should occur such as selection or branch expansion.
> If I use the following code, the left and right mouse buttons work correctly
> but the node under the mouse pointer is not selected. The popup works against
> the currently selected node, whatever that happens to be.
> Private Sub tvtreeview_Mousedown(Button As Integer, Shift As Integer, x As
> Single, Y As Single)
>   If Button <> vbRightButton Then Exit Sub

At this point, you should insert

    Set tvTreeView.SelectedItem = tvTreeView.HitTest(x, y)
    If tvTreeView.SelectedItem Is Nothing Then Exit Sub

Then go on with the rest of your code.  

--



Mon, 09 Oct 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Pop-ups in MS Office

2. pop-ups

3. downloading file without pop-ups

4. Pop-ups

5. Pop ups

6. control enumeration pop-ups at design time

7. Pop Ups

8. VB6 TreeView control node text pop-up

9. How to: ComboBox that pops down TreeView?

10. Pop Up Menu Not Popping

11. Dial Ups

 

 
Powered by phpBB® Forum Software