-
June 29th, 2010, 03:58 AM
#1
showing different panel when radio button is clicked
I have designed two radiobutton in Class Status.cs
My panels are in class GetData.cs. GetData.cs contain two panel(panel1,panel2)one above(overlapped) the other.Panel2 is shown ,Panel 1 is behind panel2.
if i click radiobutton1,panel 1 should be visible
and if i click radiobutton2,panel 2 should be visible
Now what i am doing is ,
in Status.cs
Code:
private void radiobutton1 _CheckedChanged(object sender, EventArgs e)
{
Panel panel2 = getpanel.getPanelNonProd();
Panel panel1 = getpanel.getPanelProd();
panel2.Visible = false;
panel1.Visible = true;
}
private void radiobutton2_CheckedChanged(object sender, EventArgs e)
{
Panel panel2 = getpanel.getPanelNonProd();
Panel panel1 = getpanel.getPanelProd();
panel2.Visible = true;
panel1.Visible = false;
}
Initially in design panel2 is visible.And it doesnot change on clicking radiobutton 1 or 2..so what should i do here..
Last edited by HanneSThEGreaT; June 29th, 2010 at 05:23 AM.
Reason: Added CODE Tags
-
June 29th, 2010, 05:22 AM
#2
Re: showing different panel when radio button is clicked
Use either the SendToBack or BringToFront methods instead. Also, please use &#CODE] tags when posting code.
-
June 29th, 2010, 05:59 AM
#3
Re: showing different panel when radio button is clicked
Originally Posted by HanneSThEGreaT
Use either the SendToBack or BringToFront methods instead. Also, please use &#CODE] tags when posting code.
And can u tel me what is that and where to use it
-
June 29th, 2010, 06:26 AM
#4
Re: showing different panel when radio button is clicked
-
June 29th, 2010, 07:02 AM
#5
Re: showing different panel when radio button is clicked
Originally Posted by HanneSThEGreaT
Its not working for me..I tried in Status.cs class
private void radiobutton1_CheckedChanged(object sender, EventArgs e)
{
Panel panel2 = getpanel.getPanelNonProd();
Panel panel1 = getpanel.getPanelProd();
panel2.SendToBack();
panel1.BringToFront();
}
Any suggestions?
Moreover if i am using in the same class in which panel is kept
panel2.SendToBack();
panel1.BringToFront();
This is working fine but from Status.cs class ,its not working...
Last edited by @kriti; June 29th, 2010 at 07:18 AM.
Reason: modified
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|