Hello,I am new to C#.
I have a UserControl. I could not Refresh a label text in the UserControl from another form.
The Codes are:
I have a UserControl. I could not Refresh a label text in the UserControl from another form.
The Codes are:
Code:
public partial class ImagePBX : UserControl
{
private Label label;
private string _LabelText = "Label";
public ImagePBX()
{
InitializeComponent();
this.label = new Label();
this.label.Text = _LabelText;
this.Controls.Add(label);
}
public string LabelText
{
get { return _LabelText; }
set { _LabelText = value; ; }
}
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
imagePBX1.LabelText = "string1";
imagePBX1.Refresh();
}
}
Comment