I'm doing testing. I wrote a question, and below 4 answers (the choice is made using Radiobutton). Counting is done using gauge. How to set the if structure correctly so that when choosing the right answer and pressing the corresponding button, the gauge counts +5 percent. Explain, please.

  • one
    By pressing a button, check what is selected in the radio group. If the answer is correct, increase the gauge. - Nofate

1 answer 1

Use instead of four TRadioButton one component - TRadioGroup . It is just meant for such things. And to use this component is much easier. The component has a special property - ItemIndex , which just returns the number of the selected radio frequency (counting from zero).

TRadioGroup Help .