Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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;
// 	}
//}
 
PREVIOUS NEXT
Tagged: #object #disapear #windows #form
ADD COMMENT
Topic
Name
7+8 =