C# winForm 遍历容器控件内所有Label,修改其背景色
2021-04-15 02:28
标签:c# str 遍历 win tostring control controls span inf C# winForm 遍历容器控件内所有Label,修改其背景色 标签:c# str 遍历 win tostring control controls span inf 原文地址:https://www.cnblogs.com/nb08611033/p/8890960.html //容器控件为tableLayoutPanel1
foreach (Control label in tableLayoutPanel1.Controls)
{
if (label.GetType().ToString() == "System.Windows.Forms.Label")
{
label.BackColor = Color.Red;
}
}
文章标题:C# winForm 遍历容器控件内所有Label,修改其背景色
文章链接:http://soscw.com/index.php/essay/75893.html