I am beginner to the C# and Visual Studio. I just wanted to ask how to put back-end code for a label.Just like when we press a double click on a button. It's back-end code just appears in .cs file, just like below
private void UIButton97_TouchUpInside(UIButton sender)
{
}
So can we do the same thing with a label.
Any help is appreciated.
check event that available for label, and you can add some behavior in that event. for example i will use label in my current project :
this.aboutLabel.TextChanged += new System.EventHandler(this.aboutLabel_TextChanged);
private void aboutLabel_TextChanged(object sender, EventArgs e) { //do some bahaviour in here }
The event above will be execute when text in label changed.
For simple way just right click --> properties in label element , click Events (In visual studio usually represent as thunderbolt image), double click empty field in beside event that you want to fire, see image below :
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.