var currentTxt = (RichTextBox)TabControl_Query
.SelectedTab
.Controls
.Find("RTX" + TabControl_Query.SelectedTab.TabIndex, true)
.FirstOrDefault();
I am using a BackgroundWorker
, also my Tabcontrol is dynamic so i can add new ones with a click (not static), i can use the example below on some physical existent Textboxes, labels, grids and whatever
TXT_SearchResults.Invoke((MethodInvoker)(() => TXT_SearchResults.Visible = true));
Now i can add new tabs without an issue but when i run the text inside the tab that contains a dynamic RichTextBox i will have the issue Program Shot
I get the following exception