在C#中怎么通过不同的Button的点击(或者工具栏中的Button)来实现类似与TabControl那样的在不同面版之间的转换,就是面版没有TabControl的头上的标题,不同的面版中含有不同的控件,各位能明白我的意思吗??也就是点击Button来实现页面之间的转换,谢谢帮助,在线等

解决方案 »

  1.   

    把控件放到Panel里面
    然后根据点击的按钮来判断不同panel的显示和隐藏
      

  2.   

    用Div吧,配合JavaScript控制可见性就好了。
      

  3.   

    用panel包装控件,button控制显示哪个panel
      

  4.   

    用panel包装控件,button控制显示哪个panel
      

  5.   

    是做成向导那样的效果吧,用panel吧
      

  6.   

    但是好象把控件放在panel2,panel1上也有该控件啊,为什么啊
      

  7.   

    把控件放到Panel里面
    然后根据点击的按钮来判断不同panel的显示和隐藏
    就是这样了,哈哈。
      

  8.   

    js需客户端代码panel需服务器端代码两者都行,看项目要求了
      

  9.   

    那让pannel1显示而pannel2不显示怎么实现啊
    就是pannel1.Show();
      

  10.   

    还有,这些pannel要重叠起来,也就是在一个时间内最多只能显示一个pannel,可以吗??怎么实现??
    能具体的代码给点吗??谢谢??等ing !!!
      

  11.   

    把控件放到Panel里面
    将两个Panel叠加起
    然后根据点击的按钮来判断不同panel的显示和隐藏
      

  12.   

    tabControl.SelectedTab=tabArticle你看看是这种咚咚吗 ~?
      

  13.   

    把控件放到Panel里面
    将两个Panel叠加起
    然后根据点击的按钮来判断不同panel的显示和隐藏
    =================================================
    这种就可以呀 ~
      

  14.   

    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;

    }
    }
    }