Editor Gadget character input limit.
Editor Gadget character input limit.
I have an editor gadget with wordwrap enabled. The size of the editor is small and fits 10 lines before the vertical scroll bar appears. I dont want the scroll bars to appear as i need to limit the text to the size of the box. Is there a simple way to do this?
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Editor Gadget character input limit.
SendMessage(GadgetID(<edit>), #EM_LIMITTEXT, <max chars>, 0)
Windows only.
Windows only.
BERESHEIT
Re: Editor Gadget character input limit.
Thank you
Re: Editor Gadget character input limit.
Is there a way to limit lines? I checked the constants on msdn but could see anything related to it.
Re: Editor Gadget character input limit.
Something like this could be used to limit lines....
Code: Select all
Select WindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case #Editor_0
Select EventType()
Case 1024
If CountGadgetItems(#Editor_0)>10
RemoveGadgetItem(#Editor_0,11)
EndIf
EndSelect
EndSelect
EndSelect
Last edited by PureLeo on Wed Aug 03, 2011 3:13 am, edited 1 time in total.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Editor Gadget character input limit.
You can try this: SendMessage_(GadgetID(<edit>), #EM_SHOWSCROLLBAR, #SB_VERT, 0) where the vertical scrollbar will not show.
BERESHEIT
Re: Editor Gadget character input limit.
Thanks guy's, works a treat.