Solved

Popup a non-modal dialog

Posted on 2008-06-26
4
442 Views
Last Modified: 2008-07-23
Hi All,

My application has a main interface developed by VB6.0. Is it possible to pop up a non-modal dialog under certian conditions? And this non-modal dialog will disappear automatically after 1 minute.

Please advise. Thanks.
0
Comment
Question by:cplau
  • 2
4 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 21872801
Just use a Form, and use a timer to hide it.
Option Explicit
 

Private Sub Command1_Click()

Form2.Show vbModeless

Me.Timer1.Interval = 2000

Me.Timer1.Enabled = True
 

End Sub
 

Private Sub Timer1_Timer()

Form2.Hide

Timer1.Enabled = False
 

End Sub

Open in new window

0
 
LVL 13

Expert Comment

by:jmundsack
ID: 21873702
And -- if you want to force the non-modal dialog to stay "on-top" of your main program window, do what GrahamSkan said but add the name of the main program window to the Show command:

Form2.Show vbModeless, Form1

If the above line of code is being executed from within Form1, you could also use:

Form2.Show vbModeless, Me

0
 

Author Comment

by:cplau
ID: 21881221
Hi All,

How can I ensure that this non-modal dialog will be shown on top of all windows?
0
 
LVL 13

Accepted Solution

by:
jmundsack earned 125 total points
ID: 22029451
This is exactly what you need:

How To Create a Form That Always Stays on Top
http://support.microsoft.com/kb/q184297/
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

757 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

20 Experts available now in Live!

Get 1:1 Help Now