I’m trying to get an combobox items count using the following code. It doesn’t give an error nor the the right amount of count. I guess I have to convert int to string, but how?
ComboBox1->ItemIndex = 1;
int count = ComboBox1->Items->Count;
Edit1->Text = "Count: " + count;
This line
returns the numnber of string items in your TComboBox. You need to check this before setting
as ItemIndex is used to set the selected item in the combo box and is zero counted. To convert the integer to string in Embarcadero you can use
IntToStr()functionYou will need
#include "System.hpp"to access that function