PB5.42LTS; ComboboxGadget; set selection cursor;

Windows specific forum
HanPBF
Enthusiast
Enthusiast
Posts: 564
Joined: Fri Feb 19, 2010 3:42 am

PB5.42LTS; ComboboxGadget; set selection cursor;

Post by HanPBF »

Hello!

How can I set the selection cursor in a combobox.

I found that link in PB, but it does not work: http://www.purebasic.fr/english/viewtop ... w=previous

Problem is, that I want to filter the list; after resetting the comboboxgadget items, the selection cursor in the textpart of the box jumps at the beginning.

Any ideas?

Thanks a lot!

__________________________________________________
Link repaired
16.02.2016
RSBasic
HanPBF
Enthusiast
Enthusiast
Posts: 564
Joined: Fri Feb 19, 2010 3:42 am

[SOLVED]; PB5.42LTS; ComboboxGadget; set selection cursor;

Post by HanPBF »

O.k.
found that solution:

Code: Select all

 keybd_event_(#VK_END, 0, 0, 0)
With GetGadgetText and GetGadgetState should be possible to later add autocomplete to combobox.
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: PB5.42LTS; ComboboxGadget; set selection cursor;

Post by RSBasic »

HanPBF wrote:found that solution:

Code: Select all

keybd_event_(#VK_END, 0, 0, 0)
Do you want to set the cursor to the end?

Code: Select all

EnableExplicit

Define EventID

If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ComboBoxGadget(1, 10, 10, 200, 20, #PB_ComboBox_Editable)
  AddGadgetItem(1, -1, "Item 1")
  AddGadgetItem(1, -1, "Item 2")
  AddGadgetItem(1, -1, "Item 3")
  
  SetGadgetState(1, 1)
  SetActiveGadget(1)
  SendMessage_(GetWindow_(GadgetID(1), #GW_CHILD), #EM_SETSEL, $fffffff, $fffffff)
 
  Repeat
    EventID = WaitWindowEvent()
    If EventID = #PB_Event_CloseWindow
      End
    EndIf
  ForEver
EndIf
Image
Image
Post Reply