CHeighlund
Programmer
I'm working on a form where there are several sets of radio button options, each of which has a related question and the options 'Yes', 'No', and 'N/A'. I figured it would be easiest to use radiogroup components for these (caption gives me the question for free), and so far it's working well except for one thing.
In one part, I have ten questions. On four of them, clicking 'Yes' is supposed to bring up a list of options to choose from. I've got a panel off to the side, invisible, with the four option sets in listbox components. Clicking 'Yes' in one of the four relevant radiogroup components is supposed to bring the appropriate list box up - it renders the panel and appropriate box visible (normally the panel and all four boxes are all invisible), and the listbox gets aligned to alClient, filling the panel. All of these are to be rendered invisible if the 'No' or 'N/A' answer to one of the four relevant questions is given, or if the user clicks on one of the other six questions. (The four relevant questions also hide everything [including their own boxes] before revealing their information on a yes.)
Currently, if I click on one of the four relevant questions with a yes, it brings the box up. (On-click event) Clicking on another, non-relevant question hides the box. But clicking on the 'Yes' in the first question after this doesn't bring the box back. The only way to get it back is to click on 'No' or 'N/A' (items 1 and 2 in the radiogroup) then back on 'Yes' (item 0). The code doesn't even seem to be running under these circumstances, as I put a breakpoint inside the if (rdgrpX.itemIndex = 0) block, and it never triggered unless I went through the screen gymnastics described above.
Does anyone have any suggestions for how to get the box to respond under these circumstances? Is there any way to make it do so, or will I need to swap out my radiogroups for something else (groupbox + buttons, maybe) that can do the job?
In one part, I have ten questions. On four of them, clicking 'Yes' is supposed to bring up a list of options to choose from. I've got a panel off to the side, invisible, with the four option sets in listbox components. Clicking 'Yes' in one of the four relevant radiogroup components is supposed to bring the appropriate list box up - it renders the panel and appropriate box visible (normally the panel and all four boxes are all invisible), and the listbox gets aligned to alClient, filling the panel. All of these are to be rendered invisible if the 'No' or 'N/A' answer to one of the four relevant questions is given, or if the user clicks on one of the other six questions. (The four relevant questions also hide everything [including their own boxes] before revealing their information on a yes.)
Currently, if I click on one of the four relevant questions with a yes, it brings the box up. (On-click event) Clicking on another, non-relevant question hides the box. But clicking on the 'Yes' in the first question after this doesn't bring the box back. The only way to get it back is to click on 'No' or 'N/A' (items 1 and 2 in the radiogroup) then back on 'Yes' (item 0). The code doesn't even seem to be running under these circumstances, as I put a breakpoint inside the if (rdgrpX.itemIndex = 0) block, and it never triggered unless I went through the screen gymnastics described above.
Does anyone have any suggestions for how to get the box to respond under these circumstances? Is there any way to make it do so, or will I need to swap out my radiogroups for something else (groupbox + buttons, maybe) that can do the job?