Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 31st, 2003, 09:17 PM
chuachongchee chuachongchee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 57 chuachongchee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Angry Form.Show Problem

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!!!

Reply With Quote
  #2  
Old October 31st, 2003, 11:48 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,852 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 47 m 6 sec
Reputation Power: 766
Try displaying it modal, perhaps the rest of the program shutdown destroys this form immediately.

Reply With Quote
  #3  
Old October 31st, 2003, 11:57 PM
chuachongchee chuachongchee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 57 chuachongchee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
if i were to use vbmodal, my other forms will still show right??

i need the last form to show only....

Reply With Quote
  #4  
Old November 2nd, 2003, 01:32 AM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
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

Reply With Quote
  #5  
Old November 2nd, 2003, 03:05 AM
chuachongchee chuachongchee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 57 chuachongchee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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."

Reply With Quote
  #6  
Old November 2nd, 2003, 06:26 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
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).

Reply With Quote
  #7  
Old November 3rd, 2003, 02:16 AM
chuachongchee chuachongchee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 57 chuachongchee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Form.Show Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway