Solved

Popup a non-modal dialog

Posted on 2008-06-26
4
444 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…
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…

770 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