Solved

VB6 - Clear Popup menu

Posted on 2007-11-30
3
1,024 Views
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
.hide

Any Ideas?
0
Comment
Question by:njacques
  • 2
3 Comments
 
LVL 19

Expert Comment

by:weellio
ID: 20390037
http://www.codeguru.com/columns/vb/article.php/c6541/

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

GetWindowState = Abs(Value)
or
GetWindowState = vbNormal


maybe?
0
 
LVL 7

Accepted Solution

by:
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.Enabled=True
Timer1.Interval = 10000
PopUpMenu mnuManage

Private Sub Timer1_Timer()
 
  Timer1.Enabled=False
  SendKeys "{ESC}"

End Sub

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

Expert Comment

by:tward
ID: 20402972
Or:

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

  End If

End Sub
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

762 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

26 Experts available now in Live!

Get 1:1 Help Now