I tried this before:
string st = "Unit";
foreach (Label lb in tabControl1.Items)
{
if (st.IndexOf(lb.Name) != -1)
lb.Content = "Some text";
}
Didn’t work…
Thank you for helping
EDIT: I did used .text instead of .content sorry.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Edit:
use this method instead:
but if you still want to serach every single item
you can cast every child to a control and then do whatever you want
var container = ((tabControl1.Items[0] as TabItem).Content as Panel);
foreach(Control control in container)
{
// do what you want
}