Click here to Skip to main content
15,895,784 members
Articles / Desktop Programming / Windows Forms

Context Help Made Easy

Rate me:
Please Sign up or sign in to vote.
4.93/5 (53 votes)
2 Feb 2007CPOL10 min read 268.5K   2.7K   274  
This article introduces a new way of instrumenting your code that enables help authors associate help topics with the application’s visual contexts at any time - even post-compilation – and to do so using the application’s user interface without the involvement of the developer.
namespace ContextHelpMadeEasy
{
    partial class FTestApplication
    {
        /// <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(FTestApplication));
			this.msMain = new System.Windows.Forms.MenuStrip();
			this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			this.miUI1 = new System.Windows.Forms.ToolStripMenuItem();
			this.miUI2 = new System.Windows.Forms.ToolStripMenuItem();
			this.pnlI1 = new ContextHelpMadeEasy.PanelEx();
			this.UI1RightSide1 = new ContextHelpMadeEasy.UI1RightSide();
			this.splI1 = new System.Windows.Forms.Splitter();
			this.lblI2Title = new System.Windows.Forms.Label();
			this.UI1LeftSide1 = new ContextHelpMadeEasy.UI1LeftSide();
			this.pnlI2 = new ContextHelpMadeEasy.PanelEx();
			this.lblI1Title = new System.Windows.Forms.Label();
			this.lblLastName = new System.Windows.Forms.Label();
			this.txtLastName = new ContextHelpMadeEasy.TextBoxEx();
			this.lblFirstName = new System.Windows.Forms.Label();
			this.txtFirstName = new ContextHelpMadeEasy.TextBoxEx();
			this.grpMisc = new System.Windows.Forms.GroupBox();
			this.btnDoNothingAtAll = new System.Windows.Forms.Button();
			this.lblGender = new System.Windows.Forms.Label();
			this.cbGender = new System.Windows.Forms.ComboBox();
			this.chkLikesDogs = new System.Windows.Forms.CheckBox();
			this.chkLikesCats = new System.Windows.Forms.CheckBox();
			this.lblDilemma = new System.Windows.Forms.Label();
			this.txtDilemma = new ContextHelpMadeEasy.TextBoxEx();
			this.lblSportsLeague = new System.Windows.Forms.Label();
			this.txtSportsLeague = new ContextHelpMadeEasy.TextBoxEx();
			this.lblHomeTown = new System.Windows.Forms.Label();
			this.txtHomeTown = new ContextHelpMadeEasy.TextBoxEx();
			this.msMain.SuspendLayout();
			this.pnlI1.SuspendLayout();
			this.pnlI2.SuspendLayout();
			this.grpMisc.SuspendLayout();
			this.SuspendLayout();
			// 
			// msMain
			// 
			this.msMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.fileToolStripMenuItem,
            this.viewToolStripMenuItem});
			this.msMain.Location = new System.Drawing.Point(0, 0);
			this.msMain.Name = "msMain";
			this.msMain.Size = new System.Drawing.Size(487, 24);
			this.msMain.TabIndex = 1;
			this.msMain.Text = "Main";
			// 
			// fileToolStripMenuItem
			// 
			this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.optionsToolStripMenuItem});
			this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
			this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
			this.fileToolStripMenuItem.Text = "File";
			// 
			// optionsToolStripMenuItem
			// 
			this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
			this.optionsToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
			this.optionsToolStripMenuItem.Text = "Options...";
			this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click);
			// 
			// viewToolStripMenuItem
			// 
			this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.miUI1,
            this.miUI2});
			this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
			this.viewToolStripMenuItem.Size = new System.Drawing.Size(41, 20);
			this.viewToolStripMenuItem.Text = "View";
			// 
			// miUI1
			// 
			this.miUI1.Name = "miUI1";
			this.miUI1.Size = new System.Drawing.Size(105, 22);
			this.miUI1.Text = "UI 1";
			this.miUI1.Click += new System.EventHandler(this.miUI1_Click);
			// 
			// miUI2
			// 
			this.miUI2.Name = "miUI2";
			this.miUI2.Size = new System.Drawing.Size(105, 22);
			this.miUI2.Text = "UI 2";
			this.miUI2.Click += new System.EventHandler(this.miUI2_Click);
			// 
			// pnlI1
			// 
			this.pnlI1.BackColor = System.Drawing.Color.LightGray;
			this.pnlI1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.pnlI1.ContextHelpID = "pnlI1";
			this.pnlI1.Controls.Add(this.UI1RightSide1);
			this.pnlI1.Controls.Add(this.splI1);
			this.pnlI1.Controls.Add(this.lblI2Title);
			this.pnlI1.Controls.Add(this.UI1LeftSide1);
			this.pnlI1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.pnlI1.Location = new System.Drawing.Point(0, 24);
			this.pnlI1.Name = "pnlI1";
			this.pnlI1.Size = new System.Drawing.Size(487, 326);
			this.pnlI1.TabIndex = 2;
			// 
			// UI1RightSide1
			// 
			this.UI1RightSide1.BackColor = System.Drawing.Color.Ivory;
			this.UI1RightSide1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.UI1RightSide1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.UI1RightSide1.Location = new System.Drawing.Point(129, 24);
			this.UI1RightSide1.Name = "UI1RightSide1";
			this.UI1RightSide1.Size = new System.Drawing.Size(354, 298);
			this.UI1RightSide1.TabIndex = 3;
			// 
			// splI1
			// 
			this.splI1.Location = new System.Drawing.Point(126, 24);
			this.splI1.Name = "splI1";
			this.splI1.Size = new System.Drawing.Size(3, 298);
			this.splI1.TabIndex = 2;
			this.splI1.TabStop = false;
			// 
			// lblI2Title
			// 
			this.lblI2Title.AutoSize = true;
			this.lblI2Title.Dock = System.Windows.Forms.DockStyle.Top;
			this.lblI2Title.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.lblI2Title.Location = new System.Drawing.Point(126, 0);
			this.lblI2Title.Name = "lblI2Title";
			this.lblI2Title.Size = new System.Drawing.Size(113, 24);
			this.lblI2Title.TabIndex = 6;
			this.lblI2Title.Text = "This is UI 1";
			// 
			// UI1LeftSide1
			// 
			this.UI1LeftSide1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.UI1LeftSide1.Dock = System.Windows.Forms.DockStyle.Left;
			this.UI1LeftSide1.Location = new System.Drawing.Point(0, 0);
			this.UI1LeftSide1.Margin = new System.Windows.Forms.Padding(5);
			this.UI1LeftSide1.Name = "UI1LeftSide1";
			this.UI1LeftSide1.Size = new System.Drawing.Size(126, 322);
			this.UI1LeftSide1.TabIndex = 1;
			// 
			// pnlI2
			// 
			this.pnlI2.BackColor = System.Drawing.Color.WhiteSmoke;
			this.pnlI2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.pnlI2.ContextHelpID = "pnlI2";
			this.pnlI2.Controls.Add(this.lblI1Title);
			this.pnlI2.Controls.Add(this.lblLastName);
			this.pnlI2.Controls.Add(this.txtLastName);
			this.pnlI2.Controls.Add(this.lblFirstName);
			this.pnlI2.Controls.Add(this.txtFirstName);
			this.pnlI2.Controls.Add(this.grpMisc);
			this.pnlI2.Dock = System.Windows.Forms.DockStyle.Fill;
			this.pnlI2.Location = new System.Drawing.Point(0, 24);
			this.pnlI2.Name = "pnlI2";
			this.pnlI2.Size = new System.Drawing.Size(487, 326);
			this.pnlI2.TabIndex = 3;
			// 
			// lblI1Title
			// 
			this.lblI1Title.AutoSize = true;
			this.lblI1Title.Dock = System.Windows.Forms.DockStyle.Top;
			this.lblI1Title.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
			this.lblI1Title.Location = new System.Drawing.Point(0, 0);
			this.lblI1Title.Name = "lblI1Title";
			this.lblI1Title.Size = new System.Drawing.Size(113, 24);
			this.lblI1Title.TabIndex = 5;
			this.lblI1Title.Text = "This is UI 2";
			// 
			// lblLastName
			// 
			this.lblLastName.AutoSize = true;
			this.lblLastName.Location = new System.Drawing.Point(230, 39);
			this.lblLastName.Name = "lblLastName";
			this.lblLastName.Size = new System.Drawing.Size(61, 13);
			this.lblLastName.TabIndex = 4;
			this.lblLastName.Text = "Last Name:";
			// 
			// txtLastName
			// 
			this.txtLastName.ContextHelpID = "txtLastName";
			this.txtLastName.Location = new System.Drawing.Point(294, 33);
			this.txtLastName.Name = "txtLastName";
			this.txtLastName.Size = new System.Drawing.Size(141, 20);
			this.txtLastName.TabIndex = 3;
			// 
			// lblFirstName
			// 
			this.lblFirstName.AutoSize = true;
			this.lblFirstName.Location = new System.Drawing.Point(13, 40);
			this.lblFirstName.Name = "lblFirstName";
			this.lblFirstName.Size = new System.Drawing.Size(60, 13);
			this.lblFirstName.TabIndex = 2;
			this.lblFirstName.Text = "First Name:";
			// 
			// txtFirstName
			// 
			this.txtFirstName.ContextHelpID = "txtFirstName";
			this.txtFirstName.Location = new System.Drawing.Point(77, 34);
			this.txtFirstName.Name = "txtFirstName";
			this.txtFirstName.Size = new System.Drawing.Size(141, 20);
			this.txtFirstName.TabIndex = 1;
			// 
			// grpMisc
			// 
			this.grpMisc.Controls.Add(this.btnDoNothingAtAll);
			this.grpMisc.Controls.Add(this.lblGender);
			this.grpMisc.Controls.Add(this.cbGender);
			this.grpMisc.Controls.Add(this.chkLikesDogs);
			this.grpMisc.Controls.Add(this.chkLikesCats);
			this.grpMisc.Controls.Add(this.lblDilemma);
			this.grpMisc.Controls.Add(this.txtDilemma);
			this.grpMisc.Controls.Add(this.lblSportsLeague);
			this.grpMisc.Controls.Add(this.txtSportsLeague);
			this.grpMisc.Controls.Add(this.lblHomeTown);
			this.grpMisc.Controls.Add(this.txtHomeTown);
			this.grpMisc.Location = new System.Drawing.Point(12, 60);
			this.grpMisc.Name = "grpMisc";
			this.grpMisc.Size = new System.Drawing.Size(535, 231);
			this.grpMisc.TabIndex = 0;
			this.grpMisc.TabStop = false;
			this.grpMisc.Text = "Miscellaneous Information";
			// 
			// btnDoNothingAtAll
			// 
			this.btnDoNothingAtAll.Location = new System.Drawing.Point(352, 84);
			this.btnDoNothingAtAll.Name = "btnDoNothingAtAll";
			this.btnDoNothingAtAll.Size = new System.Drawing.Size(163, 23);
			this.btnDoNothingAtAll.TabIndex = 13;
			this.btnDoNothingAtAll.Text = "Do Nothing at All";
			this.btnDoNothingAtAll.UseVisualStyleBackColor = true;
			// 
			// lblGender
			// 
			this.lblGender.AutoSize = true;
			this.lblGender.Location = new System.Drawing.Point(25, 94);
			this.lblGender.Name = "lblGender";
			this.lblGender.Size = new System.Drawing.Size(45, 13);
			this.lblGender.TabIndex = 12;
			this.lblGender.Text = "Gender:";
			// 
			// cbGender
			// 
			this.cbGender.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cbGender.FormattingEnabled = true;
			this.cbGender.Items.AddRange(new object[] {
            "Male",
            "Female"});
			this.cbGender.Location = new System.Drawing.Point(105, 86);
			this.cbGender.Name = "cbGender";
			this.cbGender.Size = new System.Drawing.Size(141, 21);
			this.cbGender.TabIndex = 11;
			// 
			// chkLikesDogs
			// 
			this.chkLikesDogs.AutoSize = true;
			this.chkLikesDogs.Location = new System.Drawing.Point(352, 62);
			this.chkLikesDogs.Name = "chkLikesDogs";
			this.chkLikesDogs.Size = new System.Drawing.Size(79, 17);
			this.chkLikesDogs.TabIndex = 10;
			this.chkLikesDogs.Text = "Likes Dogs";
			this.chkLikesDogs.UseVisualStyleBackColor = true;
			// 
			// chkLikesCats
			// 
			this.chkLikesCats.AutoSize = true;
			this.chkLikesCats.Location = new System.Drawing.Point(352, 35);
			this.chkLikesCats.Name = "chkLikesCats";
			this.chkLikesCats.Size = new System.Drawing.Size(75, 17);
			this.chkLikesCats.TabIndex = 9;
			this.chkLikesCats.Text = "Likes Cats";
			this.chkLikesCats.UseVisualStyleBackColor = true;
			// 
			// lblDilemma
			// 
			this.lblDilemma.AutoSize = true;
			this.lblDilemma.Location = new System.Drawing.Point(25, 128);
			this.lblDilemma.Name = "lblDilemma";
			this.lblDilemma.Size = new System.Drawing.Size(128, 13);
			this.lblDilemma.TabIndex = 8;
			this.lblDilemma.Text = "Greatest Ethical Dilemma:";
			// 
			// txtDilemma
			// 
			this.txtDilemma.ContextHelpID = "txtDilemma";
			this.txtDilemma.Location = new System.Drawing.Point(153, 121);
			this.txtDilemma.Multiline = true;
			this.txtDilemma.Name = "txtDilemma";
			this.txtDilemma.Size = new System.Drawing.Size(362, 96);
			this.txtDilemma.TabIndex = 7;
			// 
			// lblSportsLeague
			// 
			this.lblSportsLeague.AutoSize = true;
			this.lblSportsLeague.Location = new System.Drawing.Point(25, 66);
			this.lblSportsLeague.Name = "lblSportsLeague";
			this.lblSportsLeague.Size = new System.Drawing.Size(79, 13);
			this.lblSportsLeague.TabIndex = 6;
			this.lblSportsLeague.Text = "Sports League:";
			// 
			// txtSportsLeague
			// 
			this.txtSportsLeague.ContextHelpID = "txtSportsLeague";
			this.txtSportsLeague.Location = new System.Drawing.Point(105, 59);
			this.txtSportsLeague.Name = "txtSportsLeague";
			this.txtSportsLeague.Size = new System.Drawing.Size(141, 20);
			this.txtSportsLeague.TabIndex = 5;
			// 
			// lblHomeTown
			// 
			this.lblHomeTown.AutoSize = true;
			this.lblHomeTown.Location = new System.Drawing.Point(25, 40);
			this.lblHomeTown.Name = "lblHomeTown";
			this.lblHomeTown.Size = new System.Drawing.Size(68, 13);
			this.lblHomeTown.TabIndex = 4;
			this.lblHomeTown.Text = "Home Town:";
			// 
			// txtHomeTown
			// 
			this.txtHomeTown.ContextHelpID = "txtHomeTown";
			this.txtHomeTown.Location = new System.Drawing.Point(105, 33);
			this.txtHomeTown.Name = "txtHomeTown";
			this.txtHomeTown.Size = new System.Drawing.Size(141, 20);
			this.txtHomeTown.TabIndex = 3;
			// 
			// FTestApplication
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(487, 350);
			this.Controls.Add(this.pnlI1);
			this.Controls.Add(this.pnlI2);
			this.Controls.Add(this.msMain);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MainMenuStrip = this.msMain;
			this.Name = "FTestApplication";
			this.Text = "Application";
			this.msMain.ResumeLayout(false);
			this.msMain.PerformLayout();
			this.pnlI1.ResumeLayout(false);
			this.pnlI1.PerformLayout();
			this.pnlI2.ResumeLayout(false);
			this.pnlI2.PerformLayout();
			this.grpMisc.ResumeLayout(false);
			this.grpMisc.PerformLayout();
			this.ResumeLayout(false);
			this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.MenuStrip msMain;
        private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem miUI1;
        private System.Windows.Forms.ToolStripMenuItem miUI2;
        private ContextHelpMadeEasy.PanelEx pnlI1;
        private UI1RightSide UI1RightSide1;
        private System.Windows.Forms.Splitter splI1;
        private UI1LeftSide UI1LeftSide1;
        private ContextHelpMadeEasy.PanelEx pnlI2;
        private System.Windows.Forms.Label lblFirstName;
        private ContextHelpMadeEasy.TextBoxEx txtFirstName;
        private System.Windows.Forms.GroupBox grpMisc;
        private System.Windows.Forms.Label lblLastName;
        private ContextHelpMadeEasy.TextBoxEx txtLastName;
        private System.Windows.Forms.CheckBox chkLikesDogs;
        private System.Windows.Forms.CheckBox chkLikesCats;
        private System.Windows.Forms.Label lblDilemma;
        private ContextHelpMadeEasy.TextBoxEx txtDilemma;
        private System.Windows.Forms.Label lblSportsLeague;
        private ContextHelpMadeEasy.TextBoxEx txtSportsLeague;
        private System.Windows.Forms.Label lblHomeTown;
        private ContextHelpMadeEasy.TextBoxEx txtHomeTown;
        private System.Windows.Forms.Button btnDoNothingAtAll;
        private System.Windows.Forms.Label lblGender;
        private System.Windows.Forms.ComboBox cbGender;
        private System.Windows.Forms.Label lblI2Title;
        private System.Windows.Forms.Label lblI1Title;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager
United States United States
I've been programming in C, C++, Visual Basic and C# for over 35 years. I've worked at Sierra Systems, ViewStar, Mosaix, Lucent, Avaya, Avinon, Apptero, Serena and now Guidewire Software in various roles over my career.

Comments and Discussions