Here is an example I can think of off hand, sorry written in c#, not sure about casting objects in VB... The FindControl method has come in extremely handy for me. private void Button1_Click(object sender, System.EventArgs e) { MakeOneVisible("Panel2"); } ///
/// use to have a list of multiple objects, and request only one be visible /// /// private void MakeOneVisible(string ObjectId) { //First make them all not visible Panel1.Visible=false; Panel2.Visible=false; Panel3.Visible=false; Panel4.Visible=false; //FindControl
will find any object by ID Control cPanel = FindControl(ObjectId); //should probably be error handling here in case control is not found... //Control must be cast as type of control in order to access the correct members ((Panel)cPanel).Visible=true; }
synthmusic
Member
15 Points
3 Posts
Re: Halisce
Oct 28, 2003 10:39 AM|LINK