Pre-select items in a wxListBox? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
timg
Earned some good credits
Earned some good credits
Posts: 148
Joined: Mon Jan 23, 2006 6:52 pm

Pre-select items in a wxListBox?

Post by timg »

Is there anyway to set the selection state of items in a wxListBox?

I want to use one to allow users to select items, but I'd like to pre-load the previously selected items.
DavidHart
Site Admin
Site Admin
Posts: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart »

Hi,

wxListBox derives from wxControlWithItems, so you can use wxControlWithItems::SetSelection() to do this.

Regards,

David
Post Reply