Is it possible to find the number of items in a ListBox?

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
BruvKekw
In need of some credit
In need of some credit
Posts: 1
Joined: Sat Jan 16, 2021 2:44 am

Is it possible to find the number of items in a ListBox?

Post by BruvKekw » Sat Jan 16, 2021 2:54 am

Hi there!
I'm trying to make a program that opens a few webpages based on the user's clipboard.
It is already working and almost finished, but there's one thing I'm having a problem with.

I have an input field, where the user could add values to ignore when opening the webpages, the values are added to a wxListBox.
However, I could not find a way to find through code the number of things in a ListBox, or anything similar.

The ListBox itself must stay since there's a different function in the program that requires selecting from that ListBox.

If I could for example add all of the items to a list, I would have no problem.

What are ways to approach this issue?

BTW I am a total noob when it comes to C++, this is my first time coding in this language (I have some experience with C# and hex editing through other programs) and I've skewered the internet but found no answer for like 2-3 hours so I came here.

I will very much appreciate it if your answers will be as noob friendly as possible, thanks! :)

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 380
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Is it possible to find the number of items in a ListBox?

Post by New Pagodi » Sat Jan 16, 2021 7:11 am

Here's the documentation. The method you're looking for is GetCount().

Post Reply