Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how add splash screen for a application

Status
Not open for further replies.

SamNeo

Technical User
Jun 26, 2000
21
IN
I have disigned a splach form for my application it is appearing at the back of my mdiform what shoul I do to get it in the front when the project starts.
 
If you are loading the splash screen after your mdiform, you should hide your mdiform then show your splash form.

Or, you can show the spash screen before your load any additional forms.
Code:
Dim StartTime As Single

frmSplash.Show
StartTime = Timer
Do While Timer < StartTime + 1.5
    DoEvents
Loop
frmSplash.Hide

'Then show your MDI form
Or, if you need to force the form on top, you can use the SetWindowPos API function.
Code:
Private Declare Function SetWindowPos Lib &quot;user32&quot; (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Const SWP_NOSIZE = &amp;H1
Const SWP_NOMOVE = &amp;H2
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2

Dim i As Long

'Force Form On Top
i = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE)

'Remove Forced Setting
i = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top