Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > VB Classic

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 03-07-2003, 05:44 AM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Why doesn't this work

[Originally posted by James Boudreau]

I have a form with a command button "command1", a label "label1" a text box "text1" and a timer " timer1" This is set up to display a different caption at different intervals, However only the command button is displaying the caption. can someone tell me what is wrong that the label and text box are not displaying the text?

here is my code


Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)



Private Sub Timer1_Timer()
MousePointer = 11
ÿ ÿ Label1.Caption = "this is a test......."
ÿ ÿ Command1.Caption = "this is a test........"
ÿ ÿ Text1.Text = "this is a test........"
Sleep (3500)
ÿ ÿ Label1.Caption = "testing opening files............."
ÿ ÿ Command1.Caption = "testing opening files............."
ÿ ÿ Text1.Text = "testing opening files............."
Sleep (3000)
ÿ ÿ Label1.Caption = "test Opening Completed..."
ÿ ÿ Command1.Caption = "test Opening Completed..."
ÿ ÿ Text1.Text = "test Opening Completed..."
Sleep (2400)
ÿ ÿ Label1.Caption = "test Loading Main Window"
ÿ ÿ Command1.Caption = "test Loading Main Window"
ÿ ÿ Text1.Text = "test Loading Main Window"
Sleep (1900)
ÿ ÿ Label1.Caption = "test Loading somethingelse .... Please Wait)"
ÿ ÿ Command1.Caption = "test Loading something else .... Please Wait)"
ÿ ÿ Text1.Text = "test Loading something else .... Please Wait)"
Sleep (1500)
ÿ ÿ Label1.Caption = "Loading Complete"
ÿ ÿ Command1.Caption = "Loading Complete"
ÿ ÿ Text1.Text = "Loading Complete"
Sleep (1400)
ÿ ÿ Label1.Caption = "this is a test"
ÿ ÿ Command1.Caption = "this is a test"
ÿ ÿ Text1.Text = "this is a test"
Sleep (1000)
Timer1.Enabled = False
MousePointer = 1
Load Form2
Form2.Show
Unload Me
End Sub


when it is done form2 loads properly, the only problem is the label and text box are not displaying anything.
Reply With Quote
  #2  
Old 03-07-2003, 06:10 AM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:Why doesn't this work

[Originally posted by Larry Asher]

Try working with the DoEvents command.

Example:

...
ÿ ÿ Label1.Caption = "this is a test......."
ÿ ÿ Command1.Caption = "this is a test........"
ÿ ÿ Text1.Text = "this is a test........"
ÿ ÿ DoEvents
Sleep (3500)

Or even

...
ÿ ÿ Label1.Caption = "this is a test......."
ÿ ÿ DoEvents
ÿ ÿ Command1.Caption = "this is a test........"
ÿ ÿ DoEvents
ÿ ÿ Text1.Text = "this is a test........"
ÿ ÿ DoEvents
Sleep (3500)

One of those should work for you.

Good Luck.
Reply With Quote
  #3  
Old 03-07-2003, 07:18 AM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:Why doesn't this work

[Originally posted by Mikekay2]

use the .refresh method

i.e. label1.refresh

you could also try setting the forms clipcontrols property to false.

incidently this seems rather a bizarre use for a timer
Reply With Quote
  #4  
Old 03-07-2003, 01:33 PM
anonymous anonymous is offline
Senior Member
 
Join Date: Aug 2004
Posts: 43,023
Re:Re:Why doesn't this work

[Originally posted by James Boudreau]

the doevents worked great. I have made many programs where text is displayed on a label or text box and they always worked. I wonder why this didn't work this time? I am suppose to vote for you for helping me? Can you tell me how? In reply to mkay who also helped me, it is unusual use of a timer but it's just to give the illision that a program is loading. Thank you both for all your help.
Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 10:11 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.