社区
C#
帖子详情
怎样在C#中实现页面之间的转换
namuda
2005-03-23 02:18:54
在C#中怎么通过不同的Button的点击(或者工具栏中的Button)来实现类似与TabControl那样的在不同面版之间的转换,就是面版没有TabControl的头上的标题,不同的面版中含有不同的控件,各位能明白我的意思吗??也就是点击Button来实现页面之间的转换,谢谢帮助,在线等
...全文
226
20
打赏
收藏
怎样在C#中实现页面之间的转换
在C#中怎么通过不同的Button的点击(或者工具栏中的Button)来实现类似与TabControl那样的在不同面版之间的转换,就是面版没有TabControl的头上的标题,不同的面版中含有不同的控件,各位能明白我的意思吗??也就是点击Button来实现页面之间的转换,谢谢帮助,在线等
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
20 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
runi
2005-03-23
打赏
举报
回复
用panel
WTaoboy
2005-03-23
打赏
举报
回复
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication3
{
/// <summary>
/// Form1 の概要の説明です。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
/// <summary>
/// 必要なデザイナ変数です。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows フォーム デザイナ サポートに必要です。
//
InitializeComponent();
//
// TODO: InitializeComponent 呼び出しの後に、コンストラクタ コードを追加してください。
//
}
/// <summary>
/// 使用されているリソースに後処理を実行します。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows フォーム デザイナで生成されたコード
/// <summary>
/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
/// コード エディタで変更しないでください。
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
this.panel1.Controls.Add(this.label1);
this.panel1.Location = new System.Drawing.Point(16, 16);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(248, 168);
this.panel1.TabIndex = 0;
//
// panel2
//
this.panel2.Controls.Add(this.label2);
this.panel2.Location = new System.Drawing.Point(22, 52);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(248, 168);
this.panel2.TabIndex = 1;
this.panel2.Visible = false;
//
// label1
//
this.label1.Location = new System.Drawing.Point(40, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(80, 16);
this.label1.TabIndex = 0;
this.label1.Text = "label1";
//
// label2
//
this.label2.Location = new System.Drawing.Point(96, 104);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(104, 32);
this.label2.TabIndex = 0;
this.label2.Text = "label2";
//
// button1
//
this.button1.Location = new System.Drawing.Point(40, 240);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(80, 16);
this.button1.TabIndex = 2;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(176, 232);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(88, 24);
this.button2.TabIndex = 3;
this.button2.Text = "button2";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 12);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1);
this.Name = "Form1";
this.Text = "Form1";
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// アプリケーションのメイン エントリ ポイントです。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button2_Click(object sender, System.EventArgs e)
{
this.panel2.Visible=false;
this.panel1.Visible=true;
}
private void button1_Click(object sender, System.EventArgs e)
{
this.panel1.Visible=false;
this.panel2.Visible=true;
}
}
}
dangerousdon
2005-03-23
打赏
举报
回复
panel比较好用!
s2722357
2005-03-23
打赏
举报
回复
把控件放到Panel里面
将两个Panel叠加起
然后根据点击的按钮来判断不同panel的显示和隐藏
=================================================
这种就可以呀 ~
s2722357
2005-03-23
打赏
举报
回复
tabControl.SelectedTab=tabArticle
你看看是这种咚咚吗 ~?
nga96
2005-03-23
打赏
举报
回复
UP
WTaoboy
2005-03-23
打赏
举报
回复
把控件放到Panel里面
将两个Panel叠加起
然后根据点击的按钮来判断不同panel的显示和隐藏
namuda
2005-03-23
打赏
举报
回复
还有,这些pannel要重叠起来,也就是在一个时间内最多只能显示一个pannel,可以吗??怎么实现??
能具体的代码给点吗??谢谢??等ing !!!
zr1982930
2005-03-23
打赏
举报
回复
有道理,用Pannel。
namuda
2005-03-23
打赏
举报
回复
???谁能给点具体的代码吗?/谢谢
namuda
2005-03-23
打赏
举报
回复
那让pannel1显示而pannel2不显示怎么实现啊
就是pannel1.Show();
ycy589
2005-03-23
打赏
举报
回复
js需客户端代码
panel需服务器端代码
两者都行,看项目要求了
kgdiwss
2005-03-23
打赏
举报
回复
把控件放到Panel里面
然后根据点击的按钮来判断不同panel的显示和隐藏
就是这样了,哈哈。
namuda
2005-03-23
打赏
举报
回复
但是好象把控件放在panel2,panel1上也有该控件啊,为什么啊
godson_h
2005-03-23
打赏
举报
回复
是做成向导那样的效果吧,用panel吧
ffflyyy_470
2005-03-23
打赏
举报
回复
用panel包装控件,button控制显示哪个panel
ffflyyy_470
2005-03-23
打赏
举报
回复
用panel包装控件,button控制显示哪个panel
轻舟已过万重山
2005-03-23
打赏
举报
回复
用Div吧,配合JavaScript控制可见性就好了。
Grace_ghb
2005-03-23
打赏
举报
回复
不同的面版做成不同的用户控件吧,控制这些用户控件显示与否?
goldentimecym
2005-03-23
打赏
举报
回复
把控件放到Panel里面
然后根据点击的按钮来判断不同panel的显示和隐藏
深入剖析—【服务器硬件】与【Nginx配置】:从基础到实战
深入剖析服务器硬件和nginx配置,从基础知识到实战应用,全面解析关键组件与配置技巧,助力高效服务器管理与优化。
【Nginx】配置nginx图片服务器
想通过nginx来访问服务器上的图片 可以搭建一个nginx图片服务器。 做法如下: 先安装nginx,这里直接用yum来进行安装的 安装方法如下: https://blog.csdn.net/imliuqun123/article/details/103473154 安装完成后,到/etc/nginx/conf.d/下 复制default.conf或者直接修改default.con...
云服务器Nginx配置
使用的是ubuntu云服务器,简单配置一下服务器 一、连接到服务器上 ssh @xx.xx.xxx.xxx //服务器外网IP地址 然后按照提示输入密码即可 二、使用Nginx: sudo apt-get update //更新软件源 sudo apt-get install nginx //安装nginx nginx -v //检查是否安装成功 登录阿里云,确认域名解析到了服务器I...
nginx静态资源服务器简单配置
nginx静态资源服务器配置
nginx配置图片服务器
这几天研究了一下nginx配置图片服务器的相关内容,个人的一些收获与大家分享一下: Nginx是目前非常流行的web服务器,它起源于俄罗斯。它具有处理速度快,并发量大,占用资源极低等优点,尤其对于静态资源的处理更佳,有测试证明是apache的30倍。现在已经广泛的应用于多家门户网站、
中
大型网站
中
,作为反向代理、图片缓存服务器等。 本例是结合张宴的blog(http://blog.s135.co
C#
111,129
社区成员
642,534
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章