在C#中怎么通过不同的Button的点击(或者工具栏中的Button)来实现类似与TabControl那样的在不同面版之间的转换,就是面版没有TabControl的头上的标题,不同的面版中含有不同的控件,各位能明白我的意思吗??也就是点击Button来实现页面之间的转换,谢谢帮助,在线等
解决方案 »
- 请问异步传输时sockt如何接受数据?
- .net如何动态加载控件及其事件
- c#中调用vc动态库参数传递问题!!!
- C#TextBox只有下边框为黑色,其他边框无色并且背景色透明,请各位大哥帮忙啊
- 虽然快没分了,但还是要问啊:关于窗口间传值,谢!
- 为什么我的连接数据库时用windowsNt认证就是不行?
- Why it does not work!!!emergency!!!!
- 在线等待
- 各位帮我推荐一下学习C#的书籍吧!市场上的书太多了,不知道孰好孰坏!!
- 有没有什么办法可以传递“方法”?
- 登录界面Enter事件的捕获问题
- 最有可能的“System.Data.SqlClient.SqlException”类型的异常出现在 system.data.dll 中,是那里错了?
然后根据点击的按钮来判断不同panel的显示和隐藏
然后根据点击的按钮来判断不同panel的显示和隐藏
就是这样了,哈哈。
就是pannel1.Show();
能具体的代码给点吗??谢谢??等ing !!!
将两个Panel叠加起
然后根据点击的按钮来判断不同panel的显示和隐藏
将两个Panel叠加起
然后根据点击的按钮来判断不同panel的显示和隐藏
=================================================
这种就可以呀 ~
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;
}
}
}