public ZklTextBox() { ZklBaseControl.Init(this); ZklBaseControl.Init(textBox); textBox.BorderStyle = BorderStyle.None; textBox.ForeColor = Config.TextColor; textBox.KeyDown += (sender, args) => { OnKeyDown(args); }; textBox.KeyUp += (sender, args) => { OnKeyUp(args); }; textBox.MouseDown += (sender, args) => { OnMouseDown(args); }; textBox.MouseUp += (sender, args) => { OnMouseUp(args); }; textBox.Click += (sender, args) => { OnClick(args); }; textBox.TextChanged += (sender, args) => { OnTextChanged(args); }; textBox.KeyPress += (sender, args) => { OnKeyPress(args); }; textBox.PreviewKeyDown += (sender, args) => { OnPreviewKeyDown(args); }; Controls.Add(textBox); }
public PlayerListControl() { InitializeComponent(); SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true); AutoScroll = false; if (this.IsInDesignMode()) { return; } ZklBaseControl.Init(this); this.Items.CollectionChanged += Items_CollectionChanged; this.Scroll += PlayerListControl_Scroll; this.MouseWheel += PlayerListControl_MouseWheel; }