Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to make a object disapear in windows form c#

//object is the item on the windows form we are changing...
//change "object" to your own thing that is displayed on the screen"

System.Windows.Forms.Timer timer1 = new System.Windows.Forms.Timer();
timer1.Interval=60000;//one minute
timer1.Tick += new System.EventHandler(timer1_Tick);
timer1.Start();

private void pictureBox1_Click(object sender, EventArgs e)
{       
  //code for your activation button
    timer1.Stop();
    timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
    //do whatever you want            
    object.Visible = false;
  	//false can be changed to true to make it visible again
}

//You can also use a variable to make it switch between on and off:
//(such as..)

//class and name space stuff

//bool visibility = false;
	
//private void pictureBox1_Click(object sender, EventArgs e)
//{       
//    timer1.Stop();
//    timer1.Start();
//}
//private void timer1_Tick(object sender, EventArgs e)
//{         
// if(visibility = false)
//	{
//	object.Visible = true;
//  }
//  else if(visibility = true)
//	{
//	object.Visible = false;
// 	}
//}
Comment

PREVIOUS NEXT
Code Example
Csharp :: revitapi 
Csharp :: csharp datetime string format 
Csharp :: c# how to open file explorer 
Csharp :: c#image to bytes 
Csharp :: asp textarea 
Csharp :: car controller script unity 
Csharp :: c# object initialization can be simplified 
Csharp :: move file from one folder to another c# 
Csharp :: detect keypress c# 
Csharp :: sqrt unity 
Csharp :: ++ operator c# 
Csharp :: make an object disappear from a c# script unity 
Csharp :: how create another new app file in laravel 
Csharp :: get enum by index c# 
Csharp :: c# datetimepicker set weeks before today 
Csharp :: traversing an enum c# 
Csharp :: how to check if a value is inside an array c# 
Csharp :: C# How to change the text colour? 
Csharp :: unity click on 2d object 
Csharp :: unity cast float to int 
Csharp :: access a local varible in a different function C# 
Csharp :: delayed function unity 
Csharp :: wpf get screen size 
Csharp :: c# list remove duplicate items 
Csharp :: c# generate random number 
Csharp :: c# compile into an exe 
Csharp :: replace elements with greatest element on right side 
Csharp :: c# split on multiple characters 
Csharp :: triangle minimum path sum c# 
Csharp :: make folder with c# 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =