Comboboxgadget text right aligned

Just starting out? Need help? Post your questions and find answers here.
Little_man
Enthusiast
Enthusiast
Posts: 143
Joined: Fri Mar 29, 2013 4:55 pm
Location: The Netherland

Comboboxgadget text right aligned

Post by Little_man »

Is it possible in a comboboxgadget to align the texts to the right.

Code: Select all

OpenWindow(0, 100, 130, 220, 100, "ComboBox Sorted", #PB_Window_SystemMenu)
    cb.l = ComboBoxGadget(1, 10, 10, 200, 20, #CBS_SORT)

    For dlInc = 0 To 20
      SendMessage_(cb, #CB_ADDSTRING, 0, RSet(Str(Random(1000, 1)), 3, "0"))
    Next

    For dlInc = 0 To 100
      ;Text$ = LTrim(GetGadgetItemText(1, dlInc), "0")
      SetGadgetItemText(1, dlInc, LTrim(GetGadgetItemText(1, dlInc), "0"))
    Next
    
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Little_man
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4664
Joined: Sun Apr 12, 2009 6:27 am

Re: Comboboxgadget text right aligned

Post by RASHAD »

Hi

Code: Select all

OpenWindow(0, 100, 130, 220, 100, "ComboBox Sorted", #PB_Window_SystemMenu)
    cb.l = ComboBoxGadget(1, 10, 10, 200, 20, #CBS_SORT)

    SetWindowLongPtr_(GadgetID(1),#GWL_EXSTYLE,#WS_EX_LAYOUTRTL | 0)
    For dlInc = 0 To 20
      SendMessage_(cb, #CB_ADDSTRING, 0, RSet(Str(Random(1000, 1)), 3, "0"))
    Next

    For dlInc = 0 To 100
      ;Text$ = LTrim(GetGadgetItemText(1, dlInc), "0")
      SetGadgetItemText(1, dlInc, LTrim(GetGadgetItemText(1, dlInc), "0"))
    Next
    hwnd = FindWindow_("ComboLBox",0)
    SetWindowLongPtr_(hwnd,#GWL_EXSTYLE,#WS_EX_LAYOUTRTL | 0)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Egypt my love
Little_man
Enthusiast
Enthusiast
Posts: 143
Joined: Fri Mar 29, 2013 4:55 pm
Location: The Netherland

Re: Comboboxgadget text right aligned

Post by Little_man »

Thanks "RASHAD" for your information.

Little_man
Post Reply