简体   繁体   English

如何在Winform C#中获取我所有标签文本的列表

[英]how to get the list of all my labels text in winform C#

i have C# WinForm program. 我有C#WinForm程序。

how to get the list of all my labels text ? 如何获取我所有标签文本的列表?

i need to translate to another language. 我需要翻译成另一种语言。

more explanation: 更多说明:

i have many forms with many labels and textbox. 我有很多带有很多标签和文本框的表格。

I do not want to go one by one and change. 我不想一个接一个地改变。

That's why I want to get a list of everything 这就是为什么我想得到所有东西的清单

thanks 谢谢

Try the below code 试试下面的代码

foreach (Control control in this.Controls)
        {
            if (control is Label)
            {
                textBox1.AppendText(control.Text);
                //your code here to change the language
            }
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM