Hi,
Does any one know how to check a listbox which is row select
enabled to see if the row is empty? I have been having problems, as my program crashes if the user clicks on an empty row. I need to make it so that empty rows cannot be selected.
At the beginning of the onClick event for the listbox (I assume it is called ListBox1) insert this code:
Code:
if (ListBox1->Items[ListBox1->ItemIndex] == "")
{
//Show a message (Optional)
ShowMessage("Error!");
//exit from the function
return;
}
// else do anything you want
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.