Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

component visibility?

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I have a form with some radio groups, I also have a panel on the form with various objects. If the user selects a specific radio button, I'd like to hide a radio group in the panel and make visible two other components. How do I access the stuff inside the panel?? Thanks!
Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Never mind!! Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
I am not sure that I understand your question. Hopefully, this answer will be helpful.

Although components might be inside a panel they are not accessed using a hierarchy.

Suppose your user selects the first button in your radio group (called RadioGroup1) and you want to hide RadioGroup2 and make CheckBox1 visible then your code would look like:
Code:
procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
  if RadioGroup1.ItemIndex = 0 then begin
    RadioGroup2.visible := false;
    CheckBox1.visible := true;
  end;
end;
The code would be the same whether RadioGroup2 and CheckBox1 are in a panel or not.

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top