Results 1 to 2 of 2

Thread: Another Strange TreeView Behavior

  1. #1

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141

    Another Strange TreeView Behavior

    Ok, see if you can stay with me.

    I have 2 forms. Each form has a TreeView control on them.

    On right click of the TreeView on the first Form, I popup a menu.
    When I click the menu, the second form is shown modal to the first form. When I do this, I cannot get the menu to popup on the second form when I right click the TreeView there.

    However, if I don't right click the first form but insted use the menu from the top of the form to show the second form, I can then right click and get the popup menu on the second form.
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    The reason for this is that you can only show one pop-up menu at the time. Even if the first menu closes the Click event is still executing since you show the form modally. A work-around would be to add a Timer to your first form, set the Enabled property to False and the Interval to 10 (or something). Add the following code in the timer event:
    VB Code:
    1. Timer1.Enabled = False
    2. Form2.Show vbModal 'or whatever you call your second form
    Now simply enable the Timer in the click event of the menu.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width