How to trim leading zeros in spinbox?

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Hi,

      Try the code below. First get the EDIT handle from the SPINBOX and then modify the EDIT widget. Although it is not documented, you can pass the flag GUI_EDIT_SUPRESS_LEADING_ZEROES to the function EDIT_SetDecMode(). I will update the manual.

      C Source Code

      1. hSpinbox = SPINBOX_CreateEx(10, 10, 80, 20, WM_HBKWIN, WM_CF_SHOW, GUI_ID_SPINBOX0, 10, 100);
      2. hEdit = SPINBOX_GetEditHandle(hSpinbox);
      3. EDIT_SetDecMode(hEdit, 10, 10, 100, 0, GUI_EDIT_SUPPRESS_LEADING_ZEROES);