private void ButtonSend_Click(object sender, EventArgs e) { if (ChatTextbox.Text == " ") { // It glitches the hell out when you send just spaces } else if (ChatTextbox.Text == "") { // It glitches the hell out when you send just spaces } else { if (InCodeMode == false) // Not in code mode { // Send text here, I haven't added any code to actually send text through a network TexttoSend = ChatTextbox.Text; // For now, it stores the chat log in a textbox. We could use a string array instead, but listboxes are easier because we can see them at runtime. listBox1.Items.Add(TexttoSend); // Repaint the ChatPanel this.Refresh(); // Clear textbox ChatTextbox.Clear(); } if (InCodeMode == true) // In code mode { ChatTextbox.Size = new Size(460, 22); ChatPanel.Size = new Size(460, 408); ChatTextbox.Location = new Point(12, 448); InCodeMode = false; ChatTextbox.Multiline = false; // Send text here, I haven't added any code to actually send text through a network TexttoSend = "[Code]" + ChatTextbox.Text + "[/Code]"; // For now, it stores the chat log in a textbox. We could use a string array instead, but listboxes are easier because we can see them at runtime. listBox1.Items.Add(TexttoSend); // Repaint the ChatPanel this.Refresh(); // Clear textbox ChatTextbox.Clear(); } } }
private void ButtonCode_Click(object sender, EventArgs e) { if (InCodeMode == true) { // Code mode off ChatTextbox.Clear(); ChatTextbox.Size = new Size(460, 22); ChatPanel.Size = new Size(460, 408); ChatTextbox.Location = new Point(12, 448); InCodeMode = false; ChatTextbox.Multiline = false; this.Refresh(); } else if (InCodeMode == false) { // Code mode ChatPanel.Size = new Size(460, 251); InCodeMode = true; ChatTextbox.Multiline = true; ChatTextbox.Location = new Point(12, 291); ChatTextbox.Size = new Size(460, 177); ChatTextbox.Text = ""; } }
/// <inheritdoc /> /// <summary> /// </summary> public sealed override void CreateContent() { CreateDialogContainer(); CreateChannelContainer(); CreateMessageContainer(); CreateTextboxContainer(); CreateChannelHeaderContainer(); CreateCurrentTopicContainer(); CreateNoChannelMessageContainer(); CreateOnlineUsersHeaderContainer(); CreateOnlineUsersContainer(); ChannelHeader = new ChannelHeader(this); ChatTextbox = new ChatTextbox(this); ChatChannelList = new ChatChannelList(this); CurrentTopic = new CurrentTopic(this); OnlineUsersHeader = new OnlineUsersHeader(this); OnlineUserFilters = new OnlineUserFilters(this); OnlineUserList = new OnlineUserList(this); CreateDividerLines(); DialogContainer.X = -DialogContainer.Width; }