LB Booster
« Textbox Character Limit »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:57am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Textbox Character Limit  (Read 358 times)
Jack Kelly
Full Member
ImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 106
xx Textbox Character Limit
« Thread started on: Jun 3rd, 2016, 4:20pm »

The following code snippet was posted by Chris Iverson on the LB forum, for those who haven't seen it there. I changed the function def to a sub. It works especially well for field values in a Cheetah dbf...
Code:
NoMainWin
textbox #m.tb, 10, 10, 100, 25
open "Textbox test" for window as #m
#m, "trapclose [quit]"
call SetTextLimit hwnd(#m.tb), 5
wait

[quit]
close #m
end

sub SetTextLimit TextBoxHwnd, Limit
    CallDll #user32, "SendMessageA",_
                     TextBoxHwnd as ulong,_
                     _EM_SETLIMITTEXT as long,_
                     Limit as long,_
                     0 as long,_
                     SetTextLimit as long
end sub
 
 
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls