public static void ChangeChat(CHAT.Data selectedItem, int selectedIndex) { if (selectedIndex != -1) { // checks if the panels are filled, if so they are emtied if (!MainPanelAvailable()) { _mainPanel.Controls.Clear(); } // Start up new form: Form mainForm = new FORMS.COMPONENTS.MAINPANEL.Chat(selectedItem, _client); // Set the properties of form that is inserted into the main panel mainForm.TopLevel = false; mainForm.AutoScroll = false; _mainPanel.Controls.Add(mainForm); mainForm.Show(); } }
public Chat(CHAT.Data inputChat, USER.Data client) { SelectedChat = inputChat; Client = client; InitializeComponent(); }