Progr'amador 0 Posted July 7, 2020 Report Share Posted July 7, 2020 Boa Tarde, Já tentei algumas funções, já pesquisei na net mas também não encontrei o que preciso. tenho um TButtonGroup com vários botões e no evento onButtonClicked, queria uma função que retorne o caption do botão clicado. Abs! Quote Link to post Share on other sites
0 Jhonas 0 Posted July 8, 2020 Report Share Posted July 8, 2020 Para o TRadioGroup seria assim procedure TForm1.RadioGroup1Click(Sender: TObject); begin SHOWMESSAGE(RadioGroup1.Items.Strings[RadioGroup1.ItemIndex]); end; Para o TButtonGroup não deve ser muito diferente begin SHOWMESSAGE(ButtonGroup1.Items.Strings[ButtonGroup1.ItemIndex]); end; ou begin SHOWMESSAGE(ButtonGroup1.Items.Items[ButtonGroup1.ItemIndex].Caption) end; ou veja esses exemplos: http://docwiki.embarcadero.com/CodeExamples/XE2/en/VCLButtons(Delphi) http://www.manew.com/blog-166599-41243.html http://www.functionx.com/delphi/controls/buttongoup.htm https://www.experts-exchange.com/questions/26622600/ButtonGroup.html abraço Quote Link to post Share on other sites
0 Progr'amador 0 Posted July 8, 2020 Author Report Share Posted July 8, 2020 Valeu Jhonas Consegui aqui.. Na verdade é que tava tentando usar no evento onButtonClicked, mas ai testei no evento onClick e funcionou perfeitamente. Valeu ai. [RESOLVIDO] Quote Link to post Share on other sites
Question
Progr'amador 0
Boa Tarde,
Já tentei algumas funções, já pesquisei na net mas também não encontrei o que preciso.
tenho um TButtonGroup com vários botões e no evento onButtonClicked, queria uma função que retorne o caption do botão clicado.
Abs!
Link to post
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.