Sver
Full Member
Posts: 145
|
Post by Sver on Dec 20, 2018 5:19:36 GMT -5
Hello,
Is it possible to disable stylebits readonly for a textbox ?
(of course i can hide the textbox and show a other one)
textbox #hardware.serbios, 10, 20, 160, 30
Stylebits #hardware.serbios, _ES_READONLY, 0, 0, 0
button #hardware.disable " disable ", [dis], UL, 200, 20
open "Hardware Asset " for window as #hardware
#hardware "trapclose [quit]"
#hardware, "font consolas 14 "
wait
[quit]
close #hardware
end
[dis]
'??/
wait
|
|
|
Post by Rod on Dec 20, 2018 10:45:31 GMT -5
Again I am not sure I understand the problem, you can enable and disable without stylebits which is what you are asking for?
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Dec 20, 2018 11:54:56 GMT -5
Hello Rod,
Ok,
textbox #hardware.serbios, 10, 20, 160, 30
Stylebits #hardware.serbios, _ES_READONLY, 0, 0, 0 ,..open
or
textbox #hardware.serbios, 10, 20, 160, 30
,..open
#hardware.serbios, "!disable"
later, !enable for changing
,gives the same effect, in both situations, you can't change the text. (the color is different)
'----
My question was, can i make the textbox normal, when i used stylebits ? (readonly in this case)
|
|
|
Post by Rod on Dec 20, 2018 12:39:47 GMT -5
!enable allows text input !disable stops it. Do you need the stylebits complication?
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Dec 20, 2018 13:01:59 GMT -5
I can do it with enable/disable. I first way i used readonly and forgot the easy way. Thanks !
|
|
|
Post by metro on Dec 20, 2018 17:31:39 GMT -5
another option maybe EDIT: far too much work but it was an API learning exercise for me
NoMainWin
textbox #hardware.serbios, 10, 20, 160, 30
'Stylebits #hardware.serbios, _ES_READONLY, 0, 0, 0
button #hardware.disable " disable ", [dis], UL, 200, 20
button #hardware.enable " enable ", [enab], UL, 200, 50
open "Hardware Asset " for window as #hardware hText = hWnd(#hardware.serbios)
flag=_EM_SETREADONLY Call SendMessageLong hText,flag,0,0
#hardware "trapclose [quit]"
#hardware, "font consolas 14 " #hardware.serbios,"!setfocus"; wait
[quit]
close #hardware
end [enab] Call SendMessageLong hText,flag,0,0 #hardware.serbios,"!setfocus"; wait
[dis] Call SendMessageLong hText,flag,1,0 #hardware.serbios,"!setfocus"; wait
Sub SendMessageLong hWnd,msg,wParam,lParam CallDLL #user32, "SendMessageA",_ hWnd As uLong, _ msg As Long,_ wParam As Long,_ lParam As Long,_ re As Long end sub
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Dec 21, 2018 2:04:15 GMT -5
Ok, it is possible ! Thanks.
|
|