wxCheckListBox size, is there any way to force it to display everything?

46 views
Skip to first unread message

Tony Kennedy

unread,
May 22, 2025, 6:48:35 AMMay 22
to wx-users
I'm using a wxCheckListBox (and it's working perfectly).

There are only 10 entries, and I'm using it like a menu. I'd like to make sure the entire list is visible. At the moment, it displays using a scroll bar.

I've tried getting various sizes, nothing seems to give me the size if everything is being displayed.

wxSize szCheckListBox = m_pCheckListBox->GetSize();
wxSize szCheckListBoxVirtual = m_pCheckListBox->GetVirtualSize();

Does anyone know how to do this?

Thanks in advance,

Tony.

Vadim Zeitlin

unread,
May 22, 2025, 10:55:57 AMMay 22
to wx-u...@googlegroups.com
On Thu, 22 May 2025 03:48:35 -0700 (PDT) Tony Kennedy wrote:

TK> I'm using a wxCheckListBox (and it's working perfectly).
TK>
TK> There are only 10 entries, and I'm using it like a menu. I'd like to make
TK> sure the entire list is visible. At the moment, it displays using a scroll
TK> bar.
TK>
TK> I've tried getting various sizes, nothing seems to give me the size if
TK> everything is being displayed.
TK>
TK> wxSize szCheckListBox = m_pCheckListBox->GetSize();
TK> wxSize szCheckListBoxVirtual = m_pCheckListBox->GetVirtualSize();
TK>
TK> Does anyone know how to do this?

I don't think there is a way to do it directly, its GetBestSize()
implementation typically restricts its height to some "reasonable" value.
However you should be able to use GetCountPerPage() to check if the page
is big enough and increase its size if necessary.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
Reply all
Reply to author
Forward
0 new messages