Example #1
0
 private NativeMethods.ComboBoxInfo GetComboBoxInfo()
 {
     NativeMethods.ComboBoxInfo cbi = new NativeMethods.ComboBoxInfo();
     cbi.cbSize = Marshal.SizeOf(cbi);
     NativeMethods.GetComboBoxInfo(base.Handle, ref cbi);
     return(cbi);
 }
Example #2
0
        protected override void OnCreateControl()
        {
            base.OnCreateControl();

            NativeMethods.ComboBoxInfo cbi = GetComboBoxInfo();
            _editHandle = cbi.hwndEdit;
        }
Example #3
0
 protected override void OnHandleCreated(EventArgs e)
 {
     base.OnHandleCreated(e);
     NativeMethods.ComboBoxInfo cbi = new NativeMethods.ComboBoxInfo();
     cbi.cbSize = Marshal.SizeOf(cbi);
     NativeMethods.GetComboBoxInfo(base.Handle, ref cbi);
     _editHandle = cbi.hwndEdit;
     if (DropDownStyle != ComboBoxStyle.DropDownList)
     {
         _editNativeWindow = new EditNativeWindow(this);
     }
 }
Example #4
0
 protected override void OnCreateControl()
 {
     base.OnCreateControl();
     //设置为手动绘制
     this.DrawMode = DrawMode.OwnerDrawFixed;
     //设置固定的DropDownList样式
     this.DropDownStyle = ComboBoxStyle.DropDownList;
     this.ItemHeight    = 25;
     //设置为手动绘制
     if (!DesignMode && this.Items.Count != 0)
     {
         this.DropDownHeight = this.Items.Count * 5;
         if (this.DropDownHeight > 150)
         {
             this.DropDownHeight = 150;
         }
     }
     NativeMethods.ComboBoxInfo cbi = GetComboBoxInfo();
     _editHandle  = cbi.hwndEdit;
     dplisthandel = cbi.hwndList;
 }
Example #5
0
 private Rectangle GetDropDownButtonRect()
 {
     NativeMethods.ComboBoxInfo cbi = GetComboBoxInfo();
     return(cbi.rcButton.Rect);
 }
Example #6
0
 private bool GetComboBoxButtonPressed()
 {
     NativeMethods.ComboBoxInfo cbi = GetComboBoxInfo();
     return(cbi.stateButton ==
            NativeMethods.ComboBoxButtonState.STATE_SYSTEM_PRESSED);
 }