How to make a non-editable text area?

BlitzPlus Forums/BlitzPlus Programming/How to make a non-editable text area?

JoshK(Posted 2003) [#1]
I need a text area that can't be altered by the user.


Eikon(Posted 2003) [#2]
you should go here:
http://www.blitzcoder.com/cgi-bin/ubb-cgi/postdisplay.cgi?forum=Forum24&topic=000078

all in the same day...


EOF(Posted 2003) [#3]
; TextArea - ReadOnly
; Syntax Error

; userlib
; ************************
; .lib "user32.dll"
; SendMessage%(hwnd,msg,wParam,mParam):"SendMessageA"
; ************************


Const EM_SETREADONLY=$CF

win=CreateWindow("Read-Only Text Area",50,150,407,184,Desktop(),1)
textarea = CreateTextArea(18,26,361,96,win,1)
SetTextAreaFont textarea,LoadFont ("Tahoma",24,1)
AddTextAreaText textarea,"Edit me if you think your 'ard enough!"
lock=CreateButton("Locked (Read-Only)",100,130,120,20,win,2)
SetButtonState lock,True

SendMessage QueryObject(textarea,1),EM_SETREADONLY,1,0 ; lockdown

Repeat
	ev=WaitEvent()
	If ev=$401
		If EventSource()=lock
			SendMessage QueryObject(textarea,1),EM_SETREADONLY,ButtonState(lock),0
		EndIf
	EndIf
Until ev=$803
End