Announcement

Collapse
No announcement yet.

how-to limit edit box text lengths

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

  • how-to limit edit box text lengths

    Hello,

    does anybody know the proper way to limit the length of text in
    an edit box to ### number of characters? This is for a database
    application that has limited text fields.

    Thank you!

    ------------------
    Cheers

  • #2
    Mark --
    look EM_LIMITTEXT message
    Code:
       #Compile Exe
       #Register None
       #Dim All
       #Include "Win32Api.Inc"
    
       %ID_TextBox =  101
       Function PbMain
          Local hDlg As Long
          Dialog New 0, "10 symbols only",,, 100, 50, %WS_SYSMENU Or %WS_CAPTION To hDlg
          Control Add TextBox, hDlg, %ID_TextBox, "", 10, 15, 80, 15
          Control Send hDlg, %ID_TEXTBOX, %EM_LIMITTEXT, 10, 0
          Dialog Show Modal hDlg
       End Function
    ------------------

    Comment


    • #3
      Thank you ever so much Semen!

      ------------------
      Cheers

      Comment

      Working...
      X