get grpbuttonitem index c++ -


for (int = 1; <= 10; i++) {      buttongroup1->items->add() ;     buttongroup1->items->items[i-1]->caption = q_cat->fieldbyname("cat_name")->asstring;     buttongroup1->items->items[i-1]->onclick = buttongroup1->onclick; 

as can see here created 10 groupbuttonitems dynamically using loop here in item called "buttongroup1" , created onclick event each 1 = "buttongroup1" onclick event , here buttongroup1 onclick event

void __fastcall tfrm_test2::buttongroup1click(tobject *sender) { edit1->text = buttongroup1->itemindex; }  

but problem when click on groupbuttonitem = -1 cannot unchanged

enter image description here

and when tried item index using code

edit1->text = buttongroup1->items->items[1]->id; 

i can't group button item clicked

so can me ..

thanks solved using event called onbuttonclicked in buttongroup component events . this

     void __fastcall tfrm_orders::bg1buttonclicked(tobject *sender, int index) { edit1->text = buttongroup1->items->items[index]->id;  }  

here event name

index value index of clicked item on buttongroup


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -