Jump to content
Fórum Script Brasil
  • 0

(Resolvido) Retornar o caption do TButtonGroup


Question

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

  • 0

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

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Cloud Computing


  • Forum Statistics

    • Total Topics
      148680
    • Total Posts
      644501
×
×
  • Create New...