0
Answer

Change tabPage tab from another form

Ask a question
Tess

Tess

17y
1.7k
1
Hello,

I wonder if it's possible to change which tabPage on a tabControl has focus from another form. I'd like a different tabPage to be visible on the child form depending on which option is chosen from the Main form. Does anyone have any suggestions?

Here's what I have so far-- just a loop through to get the control. But how can I specify that the second tabPage in should be visible? The tabPage property does not appear to be available.

Thanks for any advice.
Tess

frmDetail myForm = new frmDetail();

foreach (Control c in myForm.Controls)

{

if (c.Name == "tabControlDetail")

{ ? }

}

myForm.Show();