VB6 - Clear Popup menu

Posted on 2007-11-30
Last Modified: 2013-12-25
Hey guys!

This should be an easy one... but i have not been able to succeed.

When i use:
PopupMenu (mnuManage)

on a mousedown event on a listview, the Mnu is poped up over the listview.

I want to get a timeout clear...

I can start a timer, however, i am unable to fin the eay to "destroy" the menu.

I have tried:
 .Visible = false
 .Enabled = false

Any Ideas?
Question by:njacques
  • 2
LVL 19

Expert Comment

ID: 20390037

Abs(False) = 0 = vbNormal,
Abs(True) = 1 = vbMinimized

GetWindowState = Abs(Value)
GetWindowState = vbNormal


Accepted Solution

tward earned 125 total points
ID: 20402752
One way I have been able to do it is:

' This will have a 10 Second Timeout '
Timer1.Interval = 10000
PopUpMenu mnuManage

Private Sub Timer1_Timer()
  SendKeys "{ESC}"

End Sub

I don't usually like using SendKeys, but only way I have found so far.

Expert Comment

ID: 20402972

Private Sub Timer1_Timer()
  If Me.mnuMangage.Visible = True Then
    Me.Enabled = False
    Me.Enabled = True

  End If

End Sub

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2016 VB code 9 115
Concatenate 2 userform comboboxes to a userform text box 4 61
Microsoft Access combo box help 2 44
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 51
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now