C# Exercises

Home AgriMetSoft About Contact

Ribbon Menu in Winforms c#

	    
namespace Ribbon_Control
{
  partial class Form1
  {
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
      if (disposing && (components != null))
      {
        components.Dispose();
      }
      base.Dispose(disposing);
    }

    #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()
    {
      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
      this.button1 = new System.Windows.Forms.Button();
      this.ribbon1 = new System.Windows.Forms.Ribbon();
      this.ribbonTab1 = new System.Windows.Forms.RibbonTab();
      this.ribbonPanel1 = new System.Windows.Forms.RibbonPanel();
      this.ribbonButton1 = new System.Windows.Forms.RibbonButton();
      this.ribbonTab2 = new System.Windows.Forms.RibbonTab();
      this.ribbonPanel2 = new System.Windows.Forms.RibbonPanel();
      this.ribbonTextBox1 = new System.Windows.Forms.RibbonTextBox();
      this.SuspendLayout();
      //
      // button1
      //
      this.button1.Location = new System.Drawing.Point(117, 217);
      this.button1.Name = "button1";
      this.button1.Size = new System.Drawing.Size(75, 23);
      this.button1.TabIndex = 1;
      this.button1.Text = "button1";
      this.button1.UseVisualStyleBackColor = true;
      //
      // ribbon1
      //
      this.ribbon1.Font = new System.Drawing.Font("Segoe UI", 9F);
      this.ribbon1.Location = new System.Drawing.Point(0, 0);
      this.ribbon1.Minimized = false;
      this.ribbon1.Name = "ribbon1";
      //
      //
      //
      this.ribbon1.OrbDropDown.BorderRoundness = 8;
      this.ribbon1.OrbDropDown.Location = new System.Drawing.Point(0, 0);
      this.ribbon1.OrbDropDown.Name = "";
      this.ribbon1.OrbDropDown.Size = new System.Drawing.Size(527, 447);
      this.ribbon1.OrbDropDown.TabIndex = 0;
      this.ribbon1.OrbStyle = System.Windows.Forms.RibbonOrbStyle.Office_2010;
      this.ribbon1.OrbText = "File";
      this.ribbon1.RibbonTabFont = new System.Drawing.Font("Trebuchet MS", 9F);
      this.ribbon1.Size = new System.Drawing.Size(508, 120);
      this.ribbon1.TabIndex = 2;
      this.ribbon1.Tabs.Add(this.ribbonTab1);
      this.ribbon1.Tabs.Add(this.ribbonTab2);
      this.ribbon1.TabSpacing = 3;
      this.ribbon1.Text = "ribbon1";
      //
      // ribbonTab1
      //
      this.ribbonTab1.Name = "ribbonTab1";
      this.ribbonTab1.Panels.Add(this.ribbonPanel1);
      this.ribbonTab1.Text = "Edit";
      //
      // ribbonPanel1
      //
      this.ribbonPanel1.Items.Add(this.ribbonButton1);
      this.ribbonPanel1.Name = "ribbonPanel1";
      this.ribbonPanel1.Text = "ribbonPanel1";
      //
      // ribbonButton1
      //
      this.ribbonButton1.Image = ((System.Drawing.Image)(resources.GetObject("ribbonButton1.Image")));
      this.ribbonButton1.LargeImage = ((System.Drawing.Image)(resources.GetObject("ribbonButton1.LargeImage")));
      this.ribbonButton1.Name = "ribbonButton1";
      this.ribbonButton1.SmallImage = ((System.Drawing.Image)(resources.GetObject("ribbonButton1.SmallImage")));
      this.ribbonButton1.Click += new System.EventHandler(this.ribbonButton1_Click);
      //
      // ribbonTab2
      //
      this.ribbonTab2.Name = "ribbonTab2";
      this.ribbonTab2.Panels.Add(this.ribbonPanel2);
      this.ribbonTab2.Text = "ribbonTab2";
      //
      // ribbonPanel2
      //
      this.ribbonPanel2.Items.Add(this.ribbonTextBox1);
      this.ribbonPanel2.Name = "ribbonPanel2";
      this.ribbonPanel2.Text = "ribbonPanel2";
      //
      // ribbonTextBox1
      //
      this.ribbonTextBox1.Name = "ribbonTextBox1";
      this.ribbonTextBox1.Text = "test text";
      this.ribbonTextBox1.TextBoxText = "";
      //
      // Form1
      //
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(508, 346);
      this.Controls.Add(this.ribbon1);
      this.Controls.Add(this.button1);
      this.KeyPreview = true;
      this.Name = "Form1";
      this.Text = "Form1";
      this.ResumeLayout(false);

    }

    #endregion

    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.Ribbon ribbon1;
    private System.Windows.Forms.RibbonTab ribbonTab1;
    private System.Windows.Forms.RibbonPanel ribbonPanel1;
    private System.Windows.Forms.RibbonButton ribbonButton1;
    private System.Windows.Forms.RibbonTab ribbonTab2;
    private System.Windows.Forms.RibbonPanel ribbonPanel2;
    private System.Windows.Forms.RibbonTextBox ribbonTextBox1;

  }
}
		
	 


Download the project of Visual Studio 2013 in DropBox Download


How to add Ribbon Control in Winforms C# | User Control Example


List of Exercises