12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.ComponentModel;
- using System.Windows.Forms;
- namespace Infoking.Common.Windows.Control
- {
- public class IKComboBox : ComboBox
- {
- private Container components;
- public IKComboBox()
- {
- InitializeComponent();
- base.EnabledChanged += IKComboBox_EnabledChanged;
- }
- protected override void Dispose(bool disposing)
- {
- if (disposing && components != null)
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- private void InitializeComponent()
- {
- components = new System.ComponentModel.Container();
- }
- protected override void OnPaint(PaintEventArgs pe)
- {
- base.OnPaint(pe);
- }
- protected override void OnGotFocus(EventArgs e)
- {
- SelectAll();
- }
- protected override void OnLostFocus(EventArgs e)
- {
- Select(0, 0);
- }
- private void IKComboBox_EnabledChanged(object sender, EventArgs e)
- {
- base.TabStop = base.Enabled;
- }
- }
- }
|