Announcement

Collapse
No announcement yet.

Text Box Character limiit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Text Box Character limiit

    How can I limit the # of entries in a one line text box. I would like the limit to correspond to the attached data base. PBWin 80 &/or PBForms
    Would like a beep when over the stated limit.

    Thanks,

    Dick Bottom

  • #2
    Code:
     
    Control Add TextBox, hDlg, %TXT_TEXTBOX1, "Textbox1", .....
    Control Send hDlg, %TXT_TEXTBOX1, %EM_SETLIMITTEXT, MAX_LEN&, 0
    Limits user input to MAX_LEN& characters and sounds 'Default Beep' if user tries to enter more.

    (In the example above 'Textbox1' would be included in the limit unless deleted.
    The limit does not apply to programatically entered text e.g.
    Control Set Text hWnd, %TXT_TEXTBOX1, "Some string greater in length than MAX_LEN&" 'would be accepted).
    Last edited by Dave Biggs; 17 Sep 2008, 08:15 PM. Reason: caveat
    Rgds, Dave

    Comment


    • #3
      Dave - Thanks for your help - Dick Bottom

      Comment

      Working...
      X