更新时间:2023-11-15 12:00:58
您必须从给定名称的表单控件列表中找到 Label
控件.
You have to find Label
Control from the list of form control for a given name.
var control = this.Controls.OfType<Label>()
.FirstOrDefault(c=>c.Name == labelName");
if(control != null)
{
// Now you can play with your logic.
control.Invoke((MethodInvoker)(() => control.Text = displayValue.ToString()));
}