I have created a custom control and added a label property to it so at design time we can pick a Label and assign it to that control. so basically I want that if a label is assigned to that control, its text should change as below and also its text should change to bold font, so here is that code:
private Label assignedLabel;
public Label AssignedLabel
{
get
{
return assignedLabel;
}
set
{
assignedLabel = value;
assignedLabel.Text = @"*" + assignedLabel.Text;
assignedLabel.Font = new Font(AssignedLabel.Font, FontStyle.Bold);
AssignedLabel.Refresh();
}
}
the problem is that based on the code above the Font of that assigned label is correctly changing to Bold font, but its Text is not taking affect. why is that happening? how can I fix this issue?