Solved

Popup a non-modal dialog

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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.
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…

730 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