动态修改 控件属性 2011.07.21

做filter,运行状态控件是灰色的,不可修改的


在这里用到了EnableWindow函数。

EnableWindow(m_hComboBox, FALSE);
EnableWindow(m_hEditIpAddr, FALSE);
EnableWindow(m_hEditIpPort, FALSE);
EnableWindow(m_hEditSdelay, FALSE);



EnableWindow(m_hEditIpAddrUDP, FALSE);
EnableWindow(m_hEditIpPortUDP, FALSE);
EnableWindow(m_hEditSdelayUDP, FALSE);



停止状态是白色的,可修改的



EnableWindow(m_hComboBox, TRUE);
EnableWindow(m_hEditIpAddr, TRUE);
EnableWindow(m_hEditIpPort, TRUE);
EnableWindow(m_hEditSdelay, TRUE);




EnableWindow(m_hEditIpAddrUDP, TRUE);
EnableWindow(m_hEditIpPortUDP, TRUE);
EnableWindow(m_hEditSdelayUDP, TRUE);


MSDN的是这样介绍的:

EnableWindow Function


The EnableWindow function enables or disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses. When input is enabled, the window receives all input.

Syntax

BOOL EnableWindow(      

    HWND hWnd,
    BOOL bEnable
);

Parameters

hWnd
[in] Handle to the window to be enabled or disabled.
bEnable
[in] Specifies whether to enable or disable the window. If this parameter is TRUE, the window is enabled. If the parameter is FALSE, the window is disabled.

Return Value

If the window was previously disabled, the return value is nonzero.

If the window was not previously disabled, the return value is zero. To get extended error information, call GetLastError . 


bEnable 是
TRUE的时候为可修改的,
FALSE的时候为不可修改的。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值