社区
C#
帖子详情
怎样在C#中实现页面之间的转换
namuda
2005-03-23 02:18:54
在C#中怎么通过不同的Button的点击(或者工具栏中的Button)来实现类似与TabControl那样的在不同面版之间的转换,就是面版没有TabControl的头上的标题,不同的面版中含有不同的控件,各位能明白我的意思吗??也就是点击Button来实现页面之间的转换,谢谢帮助,在线等
...全文
170
20
打赏
收藏
怎样在C#中实现页面之间的转换
在C#中怎么通过不同的Button的点击(或者工具栏中的Button)来实现类似与TabControl那样的在不同面版之间的转换,就是面版没有TabControl的头上的标题,不同的面版中含有不同的控件,各位能明白我的意思吗??也就是点击Button来实现页面之间的转换,谢谢帮助,在线等
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用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的显示和隐藏
c#
操作LibreOffice组件进行文件
转换
在
C#
中
,我们可以利用COM互操作性(Component Object Model Interop)来调用LibreOffice的服务,
实现
文件
转换
功能。以下是一些关键知识点: 1. **LibreOffice安装与配置**:首先,你需要在开发环境
中
安装...
C#
Winform Rtf Html
转换
器
在IT行业
中
,数据格式的
转换
是常见的需求之一,尤其在文本处理领域。本项目“
C#
Winform RTF Html
转换
器”是一个高效且易扩展的工具,专注于RTF(Rich Text Format)与HTML
之间
的相互
转换
。本文将深入探讨其核心...
CHM
转换
器(
c#
)可以
转换
CHM到TXT、HTML,也可以
实现
HTML->TXT,附所有源代码
CHM文件通常用于存储电子书、技术文档或软件帮助文件,而这个
转换
器能够方便用户在不同格式
之间
进行切换,满足不同的阅读和编辑需求。 首先,我们要理解CHM文件的结构。CHM是通过编译HTML文件和相关资源形成的,...
C#
-PDF文件和图片互相
转换
在本主题
中
,我们将深入探讨如何使用
C#
进行PDF文件和图片
之间
的
转换
。PDF(Portable Document Format)是一种通用的文件格式,用于保存文档的布局和内容,而图像则包含了像素数据,通常用于展示视觉信息。以下是一些...
C#
Svg
转换
为png/jpeg等图片(
C#
版)
在
C#
编程环境
中
,处理SVG与PNG或JPEG
之间
的
转换
是一项常见的需求。例如,在Web应用
中
,用户可能需要将SVG图标或图形下载为PNG或JPEG格式以便于打印或在不支持SVG的浏览器
中
显示。以下是一个详细的步骤,介绍了如何在...
C#
111,098
社区成员
642,554
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章