如何让ComboBox的下拉不能用呀,不用Enabled属性控制

解决方案 »

  1.   

    要是用Enabled属性控制的话,如何让字体的颜色为黑色呀,ForeColor属性也不行
      

  2.   

         一般情况下,列表框的宽度和选择框是一样宽的,为了让列表框变的更宽,可以用
          m_Combobox.setdroppedwidth(int width); 
    如果 你不用Enabled属性控制的话,重绘Combox,  不用下拉 为什么要用 ComBox呢 textBox 不就行了吗
      

  3.   


    如何重绘ComboBox控件呀,有没有代码呀
      

  4.   

    你这个combobox不下拉,但是留住旁边的三角的话,
    你可以简单的
    在一个Combobox上面重叠放一个TextBox.
    内容写在TextBox里。
    三角标记就用Combobox自己的。
     
      

  5.   


    [System.Runtime.InteropServices.DllImport("coredll.dll")]
            public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int wndproc);
            [System.Runtime.InteropServices.DllImport("coredll.dll")]
            public static extern int GetWindowLong(IntPtr hWnd, int nIndex);        public const int GWL_STYLE = -16;
            public const int WS_DISABLED = 0x8000000;
            public static void SetControlEnabled(Control c, bool enabled)
            {
                if (enabled)
                { SetWindowLong(c.Handle, GWL_STYLE, (~WS_DISABLED) & GetWindowLong(c.Handle, GWL_STYLE)); }
                else
                { SetWindowLong(c.Handle, GWL_STYLE, WS_DISABLED | GetWindowLong(c.Handle, GWL_STYLE)); }
            }        private void button1_Click(object sender, EventArgs e)
            {
                SetControlEnabled(this.button1, false);
                this.button1.ForeColor = Color.Red;
                SetControlEnabled(this.textBox1, false);
                this.textBox1.ForeColor = Color.Red;
            }        private void Form1_Load(object sender, EventArgs e)
            {
                SetControlEnabled(this.button1, false);
                this.button1.ForeColor = Color.Red;
                SetControlEnabled(this.textBox1, false);
                this.textBox1.ForeColor = Color.Red;
            }看这个行不!
      

  6.   

    ComboBox的DropDownHeight和DropDownWidth设为1