I am designing an instant messanger and I am using tabs to allow for multiple chats to be taking place in the same windows form.
When a new chat is opened, a new tab is added, using a User Control to make the new tab contain all of the required text boxes, buttons etc...
static public void AddChat(uint chatID)
{
tabChats.BeginInvoke(new AddTabDelegate(AddTab), new object[] { chatID });
}
private delegate void AddTabDelegate(uint chatID);
private static void AddTab(uint chatID)
{
TabPage tab = new TabPage(chatID.ToString());
tab.Controls.Add(new ChatControl(chatID, serverStream));
tabChats.TabPages.Add(tab);
}
My problem is that i need to write messages to a rich text box inside the User Control which is inside the new TabPage.
Can anyone help me?