|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|