如何让ComboBox的下拉不能用呀,不用Enabled属性控制
解决方案 »
- 求一正则
- 我做好的数据库关了机之后怎么找不到了啊?
- ComboBox 和 DataRow 的 难 题
- c#开发C/S系统的问题
- 诚心请教关于SOCKET CLOSE_WAIT问题的解决
- c#中,我用ado.net访问access数据库,怎么不能同时打开多个datareader,疑惑....正常吗????
- C#下 有SendMessageByString api函数吗
- 如何同时并存取两个表
- 太原程序员群2602318
- vs.net2003拖出控件后,排了一下版不知哪个控件对应哪个id了..??
- 事务TransactionScope() 使用了提交Commit()还需要Complete()吗?
- 标准dll , ActiveX dll
m_Combobox.setdroppedwidth(int width);
如果 你不用Enabled属性控制的话,重绘Combox, 不用下拉 为什么要用 ComBox呢 textBox 不就行了吗
如何重绘ComboBox控件呀,有没有代码呀
你可以简单的
在一个Combobox上面重叠放一个TextBox.
内容写在TextBox里。
三角标记就用Combobox自己的。
[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;
}看这个行不!