Created
December 21, 2020 20:19
-
-
Save sonerb/907aff3fc976784040da702e14df6cd5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows.Forms; | |
namespace WindowsFormsApp2 | |
{ | |
public partial class Form1 : Form | |
{ | |
MyClass mc = new MyClass(); | |
public Form1() | |
{ | |
InitializeComponent(); | |
mc.myLabel = label1; | |
} | |
private void button1_Click(object sender, EventArgs e) | |
{ | |
mc.Value = textBox1.Text; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Windows.Forms; | |
namespace WindowsFormsApp2 | |
{ | |
class MyClass | |
{ | |
public Label myLabel; | |
public string _value; | |
public string Value | |
{ | |
get | |
{ | |
return _value; | |
} | |
set | |
{ | |
_value = value; | |
myLabel.Text = _value; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment