Solved

VB6 - Clear Popup menu

Posted on 2007-11-30
3
1,035 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

739 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