how to use label to stay some time on form and unload itself
Printable View
how to use label to stay some time on form and unload itself
Have you tried Seenu's code here?
Using the code you used to solve the problem in the above thread.
vb Code:
Option Explicit Dim cnt As Integer Private Sub Form_Load() Label2.Visible = False Picture2.Height = Picture1.Height Picture2.BackColor = vbBlue Picture2.Width = 0 tm.Enabled = True tm.Interval = 1 End Sub Private Sub tm_Timer() cnt = cnt + 1 Label1.Caption = (cnt) & " % " If cnt > 100 Then Label2.Visible = True tm.Enabled = False Else Picture2.Width = (cnt / 100) * Picture1.Width End If End Sub
you are wright ..Nightwalker83 .. but i want the label should be display only once when ist time form is load .. and when in next time of form loading label should be loaded
at ist instance of form load label is displayed and unloaded
and in 2nd instance of form load label should not be displayed,,
Not sure if this is what you want?
vb Code:
Option Explicit Dim cnt As Integer Private Sub Command1_Click() Unload Me Form2.Show End Sub Private Sub Form_Initialize() tm.Enabled = True tm.Interval = 1 End Sub Private Sub Form_Load() Label2.Visible = False Picture2.Height = Picture1.Height Picture2.BackColor = vbBlue Picture2.Width = 0 End Sub Private Sub tm_Timer() cnt = cnt + 1 Label1.Caption = (cnt) & " % " If cnt > 100 Then Label2.Visible = True tm.Enabled = False cnt = 0 Else Picture2.Width = (cnt / 100) * Picture1.Width End If End Sub
thanks but i do not want to put any count system in label .. it is simple label which only should load when form is loaded and unload after few seconds .. and when in 2nd instance again form is loaded the label should not be loaded.. something like SaveSetting and GetSetting
Modify the code I have given you to make it work with the code weeluke gave you here.
Yes, but that code weeluke gave you can be modified to do what you want.
@Janu, can u attach the project herewith with some clear info abt the requirement?
sorry ! sample is here
i did not fully understand your request very good but this is what i thought might help
@janu, try this
Code:Private Sub Form_Load()
Form1.Show
Label1.Visible = False
On Error Resume Next
SaveSetting "hh", "StartupForm", "TimesRun", GetSetting("hh", "StartupForm", "TimesRun", 0) + 1
Timesrun = GetSetting("hh", "StartupForm", "TimesRun")
ProUpdate = GetSetting("hh", "StartupForm", "ProductUpdate")
If ProUpdate <> "Loaded" Then
productupdate.Show vbModal
Label1.Visible = True
End If
If booCheck = False Then
popup.Label1.Caption = "You have used this Programme - " & Timesrun & " Times"
popup.Show
booCheck = True
Else
'dont do anything
End If
End Sub
here is what else you could be asking
Sorry, but I don't get what your question. Janu, could you please explain a bit more about what you are trying to accomplish ?
:wave: