19,500
社区成员
发帖
与我相关
我的任务
分享
/// <summary>
/// 下拉列表状态消息。
/// </summary>
public const int CB_GETDROPPEDSTATE = 0x14F;
public const int CB_GETDROPPEDSTATE2 = 0x0157;
/// <summary>
/// 获取或设置下拉列表是否显示。
/// </summary>
public bool DroppedDown
{
get
{
Message comboBoxDroppedMsg;
comboBoxDroppedMsg = Message.Create(this.Handle, CB_GETDROPPEDSTATE2, IntPtr.Zero, IntPtr.Zero);
MessageWindow.SendMessage(ref comboBoxDroppedMsg);
return (comboBoxDroppedMsg.Result != IntPtr.Zero);
}
set
{
Message comboBoxDroppedMsg;
if (value)
comboBoxDroppedMsg = Message.Create(this.Handle, CB_GETDROPPEDSTATE, (IntPtr)1, IntPtr.Zero);
else
comboBoxDroppedMsg = Message.Create(this.Handle, CB_GETDROPPEDSTATE, IntPtr.Zero, IntPtr.Zero);
MessageWindow.SendMessage(ref comboBoxDroppedMsg);
}
}