|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi all...
i have done a exit window.. it tells a user how long the application has been opened. this form opens for about 5 seconds then closes the program.. i used: private sub form_unload() unload me frmexit.show vbmodeless, me end sub the form doesn't show!!... it opens and closes immediately.... i need it to be opened in the middle of the parent form. However, i have a splash screen, i used the same thing to show it.. and it works fine!!... need help!!! |
|
#2
|
|||
|
|||
|
Try displaying it modal, perhaps the rest of the program shutdown destroys this form immediately.
|
|
#3
|
|||
|
|||
|
if i were to use vbmodal, my other forms will still show right??
i need the last form to show only.... |
|
#4
|
|||
|
|||
|
I recommend a way to resolve this program:In the form.unload event,Add a delay function to take some time to show the frmexit,and then close the forms & exit...
This delay function:u can use a timer control to realize the delay time function.It only does take some time with do nothing,but at this time your frmexit can be shown.. sample code: 'delay 5 second to show the frmexit.. dim firstshow as boolean dim delaytime as integer dim closeflag as boolean sub timer1_timer() if firstshow=false then frmexit.show vbmodeless, me firstshow=ture else do events end if 'calculte the delay time delaytime=delaytime+1 'end the delay action if delaytime>=5 then timer1.enable=false closeflag=true end if end sub private sub form_unload() 'init the variable closeflag=false firstshow=false delaytimeŁ˝0 'start delaying and showing frmexit timer1.enable=true 'wait for the end of delaying do while closeflag=false do events loop 'unload all from unload frmexit unload me end sub |
|
#5
|
|||
|
|||
|
anyway...
whats the actual difference between: vbmodal and vbmodeless??? i dont get what the msdn library is saying... "When Show displays a modeless form, subsequent code is executed as it's encountered. When Show displays a modal form, no subsequent code is executed until the form is hidden or unloaded." |
|
#6
|
|||
|
|||
|
The difference between vbmodal and vbmodeless is found in the Visual Studio help or on the msdn http://msdn.microsoft.com/library/d...l/vacstform.asp
Form Constants See Also Example Specifics The following constants can be used anywhere in your code in place of the actual values: Constant Value Decription vbModeless 0 UserForm is modeless. vbModal 1 UserForm is modal (default). |
|
#7
|
|||
|
|||
|
thanks!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Form.Show Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|