Home > Enterprise >  Deleting items in TListBox using a separate button on RAD Studio
Deleting items in TListBox using a separate button on RAD Studio

Time:03-08

I am creating a simple calculator app to learn how to use RAD, but could not figure out how to delete items in the ListBox by clicking "CLR". The "CLR" button should be able to clear out both the input box and the answer box. I am using C not Delphi. If you need anything more in the codes please let me know.

example of calc

CodePudding user response:

TListBox has a public Clear() method, eg:

void __fastcall TForm1::ClrButtonClick(TObject *Sender)
{
    InputListBox->Clear();
    AnswerListBox->Clear();
}
  •  Tags:  
  • c
  • Related