本文介绍了在选项卡上添加子选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以向标签添加子标签?如果可以,有人可以告诉我如何?

举个例子.我有两个标签,例如反馈和评论.在反馈"选项卡下,我需要再创建两个选项卡,例如规则"和连接".非常感谢.

I am wonderinf if it is possible to add a sub tab to a tab? If yes can someone tell me how?

As an example. I have two tabs such as feedbacks and reviews. Under the feedbacks tab I need to create two more tabs like Rules and Conenctions. Thanks a lot.

推荐答案

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
    this.outerTabControl = new System.Windows.Forms.TabControl();
    this.tabPageFeedback = new System.Windows.Forms.TabPage();
    this.tabPageReviews = new System.Windows.Forms.TabPage();
    this.innerTabControl = new System.Windows.Forms.TabControl();
    this.tabPageRules = new System.Windows.Forms.TabPage();
    this.tabPageConnections = new System.Windows.Forms.TabPage();
    this.outerTabControl.SuspendLayout();
    this.tabPageFeedback.SuspendLayout();
    this.innerTabControl.SuspendLayout();
    this.SuspendLayout();
    //
    // outerTabControl
    //
    this.outerTabControl.Controls.Add(this.tabPageFeedback);
    this.outerTabControl.Controls.Add(this.tabPageReviews);
    this.outerTabControl.Location = new System.Drawing.Point(73, 54);
    this.outerTabControl.Name = "outerTabControl";
    this.outerTabControl.SelectedIndex = 0;
    this.outerTabControl.Size = new System.Drawing.Size(317, 266);
    this.outerTabControl.TabIndex = 0;
    //
    // tabPageFeedback
    //
    this.tabPageFeedback.Controls.Add(this.innerTabControl);
    this.tabPageFeedback.Location = new System.Drawing.Point(4, 22);
    this.tabPageFeedback.Name = "tabPageFeedback";
    this.tabPageFeedback.Padding = new System.Windows.Forms.Padding(3);
    this.tabPageFeedback.Size = new System.Drawing.Size(309, 240);
    this.tabPageFeedback.TabIndex = 0;
    this.tabPageFeedback.Text = "Feedback";
    this.tabPageFeedback.UseVisualStyleBackColor = true;
    //
    // tabPageReviews
    //
    this.tabPageReviews.Location = new System.Drawing.Point(4, 22);
    this.tabPageReviews.Name = "tabPageReviews";
    this.tabPageReviews.Padding = new System.Windows.Forms.Padding(3);
    this.tabPageReviews.Size = new System.Drawing.Size(309, 240);
    this.tabPageReviews.TabIndex = 1;
    this.tabPageReviews.Text = "Reviews";
    this.tabPageReviews.UseVisualStyleBackColor = true;
    //
    // innerTabControl
    //
    this.innerTabControl.Controls.Add(this.tabPageRules);
    this.innerTabControl.Controls.Add(this.tabPageConnections);
    this.innerTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
    this.innerTabControl.Location = new System.Drawing.Point(3, 3);
    this.innerTabControl.Name = "innerTabControl";
    this.innerTabControl.SelectedIndex = 0;
    this.innerTabControl.Size = new System.Drawing.Size(303, 234);
    this.innerTabControl.TabIndex = 0;
    //
    // tabPageRules
    //
    this.tabPageRules.Location = new System.Drawing.Point(4, 22);
    this.tabPageRules.Name = "tabPageRules";
    this.tabPageRules.Padding = new System.Windows.Forms.Padding(3);
    this.tabPageRules.Size = new System.Drawing.Size(295, 208);
    this.tabPageRules.TabIndex = 0;
    this.tabPageRules.Text = "Rules";
    this.tabPageRules.UseVisualStyleBackColor = true;
    //
    // tabPageConnections
    //
    this.tabPageConnections.Location = new System.Drawing.Point(4, 22);
    this.tabPageConnections.Name = "tabPageConnections";
    this.tabPageConnections.Padding = new System.Windows.Forms.Padding(3);
    this.tabPageConnections.Size = new System.Drawing.Size(295, 208);
    this.tabPageConnections.TabIndex = 1;
    this.tabPageConnections.Text = "Connections";
    this.tabPageConnections.UseVisualStyleBackColor = true;
    //
    // Form1
    //
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.ClientSize = new System.Drawing.Size(433, 383);
    this.Controls.Add(this.outerTabControl);
    this.Name = "Form1";
    this.Text = "Form1";
    this.outerTabControl.ResumeLayout(false);
    this.tabPageFeedback.ResumeLayout(false);
    this.innerTabControl.ResumeLayout(false);
    this.ResumeLayout(false);

}

#endregion

private System.Windows.Forms.TabControl outerTabControl;
private System.Windows.Forms.TabPage tabPageFeedback;
private System.Windows.Forms.TabControl innerTabControl;
private System.Windows.Forms.TabPage tabPageRules;
private System.Windows.Forms.TabPage tabPageConnections;
private System.Windows.Forms.TabPage tabPageReviews;


这篇关于在选项卡上添加子选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 01:42
查看更多