LB Booster
« limiting text in combo box »

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



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: limiting text in combo box  (Read 338 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx limiting text in combo box
« Thread started on: May 31st, 2015, 3:45pm »

How can I limit the number of characters typed into the the textbox
section of a combo box?

Some modification of this call for a regular textbox, maybe?

Code:
calldll #user32, "SendMessageA",htext as word,_EM_LIMITTEXT as word, lmt as word, 0 as long, r as long
 


r.m.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: limiting text in combo box
« Reply #1 on: May 31st, 2015, 5:32pm »

on May 31st, 2015, 3:45pm, Alincon wrote:
How can I limit the number of characters typed into the the textbox section of a combo box? Some modification of this call for a regular textbox, maybe?

Edit: Janet pointed out at the LB Forum that there is in fact an equivalent constant _CB_LIMITTEXT that you can use directly, which is simpler than the solution I posted earlier:

Code:
    array$(1) = "First item"
    array$(2) = "Second item"
    combobox #w.cb, array$(), [cbclick], 20, 20, 270, 40
    open "Combobox Limit Text" for window as #w
    #w "trapclose [quit]"
    hwndCB = hwnd(#w.cb)
    limit = 10
    calldll #user32, "SendMessageA", hwndCB as ulong, _
      _CB_LIMITTEXT as long, limit as long, 0 as long, ret as long
    wait

[quit]
    close #w
    end 

« Last Edit: Jun 1st, 2015, 09:13am by Richard Russell » 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