示例#1
0
        public ChatWindow()
        {
            Style = "window";
            Resizable = false;
            Size = new Point(512, 140);
            MinSize = new Point(512, 140);
            MaxSize = new Point(786, 512);

            handle = new Button {
                Size = new Point(16, 16),
                Position = new Point(512 - 16, 0),
                Style = "handleNE",
                Anchor = AnchorStyles.Top | AnchorStyles.Right,
                Cursor = Cursors.SizeNESW
            };
            handle.MouseDown += handle_OnMouseDown;
            handle.MousePress += handle_OnMousePress;
            Elements.Add(handle);

            input = new TextBox {Size = new Point(100, 35), Dock = DockStyle.Bottom};
            input.TextCommit += Input_OnTextCommit;
            input.Style = "textbox";
            input.Margin = new Margin(2);
            Controls.Add(input);

            tabs = new TabControl {Dock = DockStyle.Fill};
            tabs.ButtonFrame.Size = new Point(28, 28);
            Controls.Add(tabs);

            GeneralChat = AddPage("General");
            CombatChat = AddPage("Combat");
        }
示例#2
0
        private ChatTab AddPage(string name)
        {
            var page = new TabPage();
            page.Button.Text = name;
            page.Button.Size = new Point(100, 10);

            var chat = new ChatTab();
            page.Controls.Add(chat);
            tabs.TabPages.Add(page);
            ActiveChat = chat;
            return chat;
        }