Setting the ReadOnly Style property in a control (OpenInsight 32-Bit)
At 04 MAR 2004 05:54:33PM Leon Shaffer wrote:
I need to be able to change (turn on / turn off) the ReadOnly style in a control. I believe it is in the style property, but need some assistance with this. I did some research in the knowledge base, and it had a program - I tried the program and it did not work ,so I am requesting assistance here!!!
At 04 MAR 2004 06:56PM Mike Ruane wrote:
Leon-
Here's a code snippet that made all controls read-only on a screen, except for the key field. Hope it helps.
* mtr 2-22-2000
declare function Get_Property, Set_Property
AddStyle=2048
map=Get_Property(Win_name, 'CTRLMAP')
num_controls=count(map, @fm ) + (map # '')
for i=2 to num_controls CtrlEntID=map[i] column=Get_Property(CtrlEntID, 'COLUMN') ctlType=Get_Property(CtrlEntID, 'TYPE') table =Get_Property(CtrlEntID, 'TABLE') Col_no=xlate('DICT.':TABLE, Column, 2, 'X') if col_no # 0 then * get the current style if CtlType=RADIOGROUP' or CtlType=CHECKBOX' THEN x=Set_Property(CtrlEntID, "ENABLED", 0) end else Style=Get_Property(CtrlEntID, "STYLE") if Style 1,2 _eqc "0x" then convert @lower.case to @upper.case in Style MX") end * add the new style Style=bitor(Style, AddStyle) x=Set_Property(CtrlEntID, "STYLE", Style) End End next i
At 04 MAR 2004 07:10PM Leon Shaffer wrote:
Mike,
Thank you for the response…the 2048 was what I was looking for for the set readonly bit for a control, but how would I set the control back for edit mode instead of readonly?
I need to be able to toggle the readonly bit of a control to on or off…
At 04 MAR 2004 07:19PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Leon,
Check out this threadfor more information on setting edit controls to readonly or search the site for EM_SETREADONLY which is the actual windows message you need.
World leaders in all things RevSoft