How can I get and set the 'read-only' property of an edit box?
如何获取和设置编辑框的“只读”属性?
3 个解决方案
#1
The CEdit class has a SetReadOnly method which can be called at run-time. Details on MSDN: http://msdn.microsoft.com/en-gb/library/aa279328(VS.60).aspx
CEdit类有一个SetReadOnly方法,可以在运行时调用。有关MSDN的详细信息:http://msdn.microsoft.com/en-gb/library/aa279328(VS.60).aspx
#2
GetDlgItem(blah)->SendMessage(EM_SETREADONLY ,1 ,0);
This will set it to read only.
这将把它设置为只读。
#3
From the design window: right-click the edit box, select properties. Its the last option on the Styles tab.
从设计窗口:右键单击编辑框,选择属性。它是样式选项卡上的最后一个选项。
#1
The CEdit class has a SetReadOnly method which can be called at run-time. Details on MSDN: http://msdn.microsoft.com/en-gb/library/aa279328(VS.60).aspx
CEdit类有一个SetReadOnly方法,可以在运行时调用。有关MSDN的详细信息:http://msdn.microsoft.com/en-gb/library/aa279328(VS.60).aspx
#2
GetDlgItem(blah)->SendMessage(EM_SETREADONLY ,1 ,0);
This will set it to read only.
这将把它设置为只读。
#3
From the design window: right-click the edit box, select properties. Its the last option on the Styles tab.
从设计窗口:右键单击编辑框,选择属性。它是样式选项卡上的最后一个选项。