January 24, 2021, 01:05:30 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
BlitzPlus Gui
»
[bb] Kev's READONLY TextArea by Ked [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Kev's READONLY TextArea by Ked [ 1+ years ago ] (Read 522 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Kev's READONLY TextArea by Ked [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:39 AM »
Title :
Kev's READONLY TextArea
Author :
Ked
Posted :
1+ years ago
Description :
I was searching for a way to make a readonly textarea and good ole Kev had posted this as an answer to a post a couple of years ago. I thought I should put it up here just in case someone else might need it.
Code :
Code: BlitzBasic
; .lib "user32.dll"
; user32_SendMessage%(hWnd%,Msg%,wParam%,lParam%):"SendMessageA"
Const
ES_READONLY = $800
Const
EM_SETREADONLY = $CF
; Example provided by Mag, added to documentation by Mark Tiffany
win = CreateWindow
(
"Test Text Area"
,
0
,
0
,
300
,
300
)
; create a window first
txtbox = CreateTextArea
(
0
,
0
,
200
,
200
,win
)
; <--- CREATE TEXTAREA (Multi line text field)
hwnd = QueryObject
(
txtbox,
1
)
user32_SendMessage
(
hwnd,EM_SETREADONLY,
1
,
0
)
user32_SendMessage
(
hwnd,ES_READONLY,
1
,
0
)
SetGadgetText txtbox,
"Type anything (multiline) "
+
Chr
$
(
13
)
+
"And press Get Text button"
;put some text on that textare for info
gt=CreateButton
(
"Get Text"
,
200
,
0
,
80
,
20
,win
)
;create button
Repeat
id=WaitEvent
(
)
;wait for user action (in a form of event)
If
id=$803
Then
End
;to quit program when receive Window close event
If
id=$401
And
EventSource
(
)
=gt
Then
;when ok is press
Notify
"This is your text in TextArea:"
+
Chr
$
(
13
)
+TextAreaText$
(
txtbox
)
;<<--TO GET TEXT FROM TEXTFIELD
End If
Forever
Comments :
JoshK(Posted 1+ years ago)
There is a creation flag in BlitzMax for this.
Ked(Posted 1+ years ago)
This is for BlitzPlus.
TaskMaster(Posted 1+ years ago)
Ah, one of the things I hate about this Showcase forum. It is a pain in the butt to figure out which language each entry is for.People should put the target language(s) at the top of their post.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
BlitzPlus Gui
»
[bb] Kev's READONLY TextArea by Ked [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal