Solved

VB6 - Clear Popup menu

Posted on 2007-11-30
3
1,025 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

862 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

25 Experts available now in Live!

Get 1:1 Help Now