Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
How to set visible to label1 = false if textbox1 !=null every 15 second ?
I have windows form c# vs2015 form1
have label1 and textbox1
i need to set label1.visible=false ; after 15 second from textbox1 have value
to explain more
suppose i open form1 and write in textbox1 michel after writing michel by 15 second
set visible to label1=false
and if textbox1 not have value not execute visible to false to label1 after 15 second
so that how to do that please ?

What I have tried:

How to set visible to label1 = false if textbox1 !=null every 15 second ?
Posted
Updated 26-Feb-17 2:47am
Comments
PIEBALDconsult 26-Feb-17 9:26am    
Why would you need to? I see no need for involving time.
Why not simply use Textbox_TextChange to toggle the state of the Label's Visible property?
[no name] 26-Feb-17 10:04am    
If you haven't learned very basic C# programming after 3 years, maybe it's past time to find some other way to pass your time instead of being a help vampire. The world needs burger flippers too.
Maciej Los 26-Feb-17 10:48am    
Why do you need such of functionality?

1 solution

In the Textbox_TextChange event, start a timer event. When the Timer_Tick event fires, change the label state.
 
Share this answer
 
Comments
ahmed_sa 26-Feb-17 9:17am    
can you please tell me how to represent Timer_Tick event in code
Graeme_Grant 26-Feb-17 9:24am    
We are not here to write the code for you. We will point you in the right direction. What I have written above will do the job.

Also, Google is your friend: vb timer example - Google[^]
ahmed_sa 26-Feb-17 10:52am    
please help me to more explain what i need is to
to more explain
suppose i need to do action after 10 second

i write in textbox1 Michel

counter of timer will counting 0,1,2,3,4,5,6

in second no 6

i change text box to martin

timer will execute after 4 second

but what i need is to starting from second 0 in the moment i changed text box
Graeme_Grant 26-Feb-17 10:59am    
Please look at the link. The answer is there.
Ralf Meier 26-Feb-17 11:32am    
to give you an idea :
programming means to divide an action into small steps.
For your case (without any code) - what do you think what must be done for your example (step by step) ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900