Board index » cppbuilder » Syntax for inserting lines in ComboBoxes

Syntax for inserting lines in ComboBoxes


2005-01-24 12:37:06 PM
cppbuilder82
Can someone please write an example of inserting a common C string into a ComboBox? Also, how would a person delete such entries?
Thanks!
Don P.
 
 

Re:Syntax for inserting lines in ComboBoxes

Don P. wrote:
Quote
Can someone please write an example of inserting a common C string into a ComboBox? Also, how would a person delete such entries?
Have a look at
ComboBox1->Items->Add ( .. );
ComboBox1->Items->Insert ( .. );
ComboBox1->Items->Delete ( .. );
Hans.
 

Re:Syntax for inserting lines in ComboBoxes

To insert a C string, use this method :
ComboBox->Items->Add(AnsiString(MyCStr)); // where MyCStr is a char*
To delete them, use this :
int Index = ComboBox->ItemIndex;
if(Index>-1){
ComboBox->ItemIndex = Index - 1;
ComboBox->Items->Delete(Index);
}
--
Jonathan
" Don P." < XXXX@XXXXX.COM >wrote in message
Quote

Can someone please write an example of inserting a common C string into a
ComboBox? Also, how would a person delete such entries?

Thanks!

Don P.
 

{smallsort}