标题:[求助]请教Panel的使用问题?
取消只看楼主
xinghun868
Rank: 1
等 级:新手上路
帖 子:62
专家分:0
注 册:2007-6-1
 问题点数:0 回复次数:2 
[求助]请教Panel的使用问题?

private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
Panel1.Visible=true;
Panel2.Visible=false;
Panel3.Visible=false;
}
}

private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);

}

private void Button1_Click(object sender, System.EventArgs e)
{
Panel2.Visible=true;
Panel1.Visible=false;
}

private void Button2_Click(object sender, System.EventArgs e)
{
Panel3.Visible=true;
Panel2.Visible=false;
Label12.Text="你填写的资料为:"+"<br>"+
"用户名:"+TextBox2.Text+"<br>"+
"密码:"+TextBox1.Text+"<br>"+
"身份:"+DropDownList1.SelectedItem.Text+"<br>"+
"电话:"+TextBox3.Text+"<br>"+
"住址:"+TextBox4.Text+"<br>"+
"邮箱:"+TextBox5.Text+"<br>";
}


<%@ Page language="c#" Codebehind="zhucejiamian.aspx.cs" AutoEventWireup="false" Inherits="医院信息管理.zhucejiamian" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>zhucejiamian</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<FONT face="宋体">&nbsp;
<asp:label id="Label2" style="Z-INDEX: 101; LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server"
Height="32px" Width="968px" BackColor="Lavender" Font-Size="X-Large">注册信息填写</asp:label><asp:label id="Label1" style="Z-INDEX: 102; LEFT: 0px; POSITION: absolute; TOP: 32px" runat="server"
Height="526px" Width="64px" BackColor="Lavender"></asp:label>
<asp:Panel id="Panel1" style="Z-INDEX: 103; LEFT: 160px; POSITION: absolute; TOP: 48px" runat="server"
Height="136px" Width="392px">
<asp:Label id="Label6" runat="server" Width="392px" Height="24px" BackColor="Gray">第一步:</asp:Label>
<asp:Label id="Label7" runat="server" Width="96px" Height="26px">用户名:</asp:Label>
<asp:TextBox id="TextBox2" runat="server" Width="192px" Height="32px"></asp:TextBox>
<BR>
<asp:Label id="Label3" runat="server" Width="96px" Height="26px">密码:</asp:Label>
<asp:TextBox id="TextBox1" runat="server" Width="192px" Height="32px"></asp:TextBox>
<BR>
<asp:Label id="Label4" runat="server" Width="96px" Height="24px">你的身份是:</asp:Label>
<asp:DropDownList id="DropDownList1" runat="server" Width="192px" Height="32px">
<asp:ListItem Value="管理员">管理员</asp:ListItem>
<asp:ListItem Value="医生">医生</asp:ListItem>
<asp:ListItem Value="病人">病人</asp:ListItem>
<asp:ListItem Value="领导">领导</asp:ListItem>
</asp:DropDownList>
</asp:Panel>
<asp:Button id="Button1" style="Z-INDEX: 104; LEFT: 288px; POSITION: absolute; TOP: 208px" runat="server"
Width="104px" Height="32px" Text="下一步"></asp:Button>
<asp:Panel id="Panel2" style="Z-INDEX: 105; LEFT: 160px; POSITION: absolute; TOP: 256px" runat="server"
Width="376px" Height="160px">
<asp:Label id="Label5" runat="server" Width="400px" Height="32px" BackColor="Gray">第二步</asp:Label>
<asp:Label id="Label8" runat="server" Width="104px" Height="24px">电话:</asp:Label>
<asp:TextBox id="TextBox3" runat="server" Width="208px" Height="32px"></asp:TextBox>
<asp:Label id="Label9" runat="server" Width="104px" Height="32px">住址:</asp:Label>
<asp:TextBox id="TextBox4" runat="server" Width="209px" Height="32px"></asp:TextBox>
<asp:Label id="Label10" runat="server" Width="104px" Height="32px">邮箱:</asp:Label>
<asp:TextBox id="TextBox5" runat="server" Width="208px" Height="40px"></asp:TextBox>
</asp:Panel>
<asp:Button id="Button2" style="Z-INDEX: 106; LEFT: 312px; POSITION: absolute; TOP: 432px" runat="server"
Width="80px" Height="32px" Text="完成"></asp:Button>
<asp:Panel id="Panel3" style="Z-INDEX: 107; LEFT: 160px; POSITION: absolute; TOP: 480px" runat="server"
Width="400px" Height="104px">
<asp:Label id="Label11" runat="server" Width="400px" Height="28px" BackColor="Gray">恭喜你,注册成功!</asp:Label>
<asp:Label id="Label12" runat="server" Width="392px" Height="60px"></asp:Label>
</asp:Panel></FONT></form>
</body>
</HTML>


调试后Panel2,Panel3是隐藏了,但里面的那些控件还是没有隐藏啊
请问为什么我的不能实现啊???

搜索更多相关主题的帖子: Panel System void false Click 
2007-09-20 15:52
xinghun868
Rank: 1
等 级:新手上路
帖 子:62
专家分:0
注 册:2007-6-1
得分:0 

我放进去了啊.可是不会一起隐藏啊


2007-09-20 16:04
xinghun868
Rank: 1
等 级:新手上路
帖 子:62
专家分:0
注 册:2007-6-1
得分:0 
我是直接在页面中把控件拖到Panel中啊!!可是就是出现上面的问题啊

2007-09-24 10:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-171536-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020287 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved