Click here to Skip to main content
15,894,460 members
Articles / Desktop Programming / Windows Forms

InternetToolTip

Rate me:
Please Sign up or sign in to vote.
5.00/5 (28 votes)
2 Dec 2011CPOL15 min read 47.3K   3K   64  
A better ToolTip for Windows Forms and more.
namespace Test
{
    partial class Demo
    {
        /// <summary>
        /// Erforderliche Designervariable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Verwendete Ressourcen bereinigen.
        /// </summary>
        /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Vom Windows Form-Designer generierter Code

        /// <summary>
        /// Erforderliche Methode für die Designerunterstützung.
        /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Demo));
            rsi.Controls.iToolTip.StringDataProvider stringDataProvider2 = new rsi.Controls.iToolTip.StringDataProvider();
            rsi.Controls.iToolTip.StringDataProvider stringDataProvider1 = new rsi.Controls.iToolTip.StringDataProvider();
            this.button1 = new System.Windows.Forms.Button();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.label1 = new System.Windows.Forms.Label();
            this.lightBulb2 = new rsi.Controls.iToolTip.LightBulb();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.panel1 = new System.Windows.Forms.Panel();
            this.checkBox1 = new System.Windows.Forms.CheckBox();
            this.trackBar1 = new System.Windows.Forms.TrackBar();
            this.toolTipTextBox1 = new rsi.Controls.iToolTip.ToolTipTextBox();
            this.lightBulb1 = new rsi.Controls.iToolTip.LightBulb();
            this.internetToolTip1 = new rsi.Controls.iToolTip.InternetToolTip();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
            this.SuspendLayout();
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(239, 205);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(120, 36);
            this.button1.TabIndex = 0;
            this.button1.Text = "button1";
            this.internetToolTip1.SetToolTip(this.button1, "A simple button with some tooltip");
            this.button1.UseVisualStyleBackColor = true;
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Controls.Add(this.lightBulb2);
            this.groupBox1.Location = new System.Drawing.Point(15, 38);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(234, 66);
            this.groupBox1.TabIndex = 3;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Some groupbox";
            this.internetToolTip1.SetToolTip(this.groupBox1, "");
            // 
            // label1
            // 
            this.label1.Location = new System.Drawing.Point(6, 16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(192, 42);
            this.label1.TabIndex = 1;
            this.label1.Text = "Another groupbox content with some lightbulb.";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.internetToolTip1.SetToolTip(this.label1, "");
            // 
            // lightBulb2
            // 
            this.lightBulb2.BackColor = System.Drawing.Color.Transparent;
            this.lightBulb2.Lightbulb = ((System.Drawing.Bitmap)(resources.GetObject("lightBulb2.Lightbulb")));
            this.lightBulb2.Location = new System.Drawing.Point(204, 29);
            this.lightBulb2.Name = "lightBulb2";
            this.lightBulb2.Size = new System.Drawing.Size(24, 24);
            this.lightBulb2.TabIndex = 0;
            this.lightBulb2.Text = "lightBulb2";
            this.internetToolTip1.SetToolTip(this.lightBulb2, "Interesting - this lightbulb tooltip is placed in a groupbox.");
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.panel1);
            this.groupBox2.Location = new System.Drawing.Point(12, 110);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(347, 89);
            this.groupBox2.TabIndex = 4;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Another groupbox";
            this.internetToolTip1.SetToolTip(this.groupBox2, "");
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.checkBox1);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(3, 16);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(341, 70);
            this.panel1.TabIndex = 0;
            this.internetToolTip1.SetToolTip(this.panel1, "");
            // 
            // checkBox1
            // 
            this.checkBox1.AutoSize = true;
            this.checkBox1.Location = new System.Drawing.Point(72, 25);
            this.checkBox1.Name = "checkBox1";
            this.checkBox1.Size = new System.Drawing.Size(202, 17);
            this.checkBox1.TabIndex = 0;
            this.checkBox1.Text = "A checkbox in a panel in a groupbox.";
            this.internetToolTip1.SetToolTip(this.checkBox1, "Here a little bit more text is required in order to explain...");
            this.checkBox1.UseVisualStyleBackColor = true;
            // 
            // trackBar1
            // 
            this.trackBar1.Location = new System.Drawing.Point(255, 38);
            this.trackBar1.Name = "trackBar1";
            this.trackBar1.Size = new System.Drawing.Size(104, 45);
            this.trackBar1.TabIndex = 6;
            this.internetToolTip1.SetToolTip(this.trackBar1, "Here is some more content.");
            // 
            // toolTipTextBox1
            // 
            this.toolTipTextBox1.Cue = "Simple example hint...";
            this.toolTipTextBox1.Location = new System.Drawing.Point(15, 12);
            this.toolTipTextBox1.Name = "toolTipTextBox1";
            this.toolTipTextBox1.Size = new System.Drawing.Size(344, 20);
            this.toolTipTextBox1.TabIndex = 7;
            this.internetToolTip1.SetToolTip(this.toolTipTextBox1, "");
            this.toolTipTextBox1.ToolTip = "This is a more extended tooltip on this simple example";
            this.toolTipTextBox1.ToolTipData = stringDataProvider2;
            // 
            // lightBulb1
            // 
            this.lightBulb1.BackColor = System.Drawing.Color.Transparent;
            this.lightBulb1.Lightbulb = ((System.Drawing.Bitmap)(resources.GetObject("lightBulb1.Lightbulb")));
            this.lightBulb1.Location = new System.Drawing.Point(297, 89);
            this.lightBulb1.Name = "lightBulb1";
            this.lightBulb1.Size = new System.Drawing.Size(24, 24);
            this.lightBulb1.TabIndex = 2;
            this.lightBulb1.Text = "lightBulb1";
            this.internetToolTip1.SetToolTip(this.lightBulb1, "Here is another lightbulb tooltip.");
            // 
            // internetToolTip1
            // 
            this.internetToolTip1.DataProvider = stringDataProvider1;
            this.internetToolTip1.LoadText = "Please wait while the ToolTip is being generated...";
            // 
            // Demo
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(377, 262);
            this.Controls.Add(this.toolTipTextBox1);
            this.Controls.Add(this.trackBar1);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.lightBulb1);
            this.Controls.Add(this.button1);
            this.Name = "Demo";
            this.Text = "iToolTip Test Application";
            this.groupBox1.ResumeLayout(false);
            this.groupBox2.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button button1;
        private rsi.Controls.iToolTip.LightBulb lightBulb1;
        private rsi.Controls.iToolTip.InternetToolTip internetToolTip1;
        private System.Windows.Forms.GroupBox groupBox1;
        private rsi.Controls.iToolTip.LightBulb lightBulb2;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.CheckBox checkBox1;
        private System.Windows.Forms.TrackBar trackBar1;
        private rsi.Controls.iToolTip.ToolTipTextBox toolTipTextBox1;
        private System.Windows.Forms.Label label1;
    }
}

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
Chief Technology Officer
Germany Germany
Florian lives in Munich, Germany. He started his programming career with Perl. After programming C/C++ for some years he discovered his favorite programming language C#. He did work at Siemens as a programmer until he decided to study Physics.

During his studies he worked as an IT consultant for various companies. After graduating with a PhD in theoretical particle Physics he is working as a senior technical consultant in the field of home automation and IoT.

Florian has been giving lectures in C#, HTML5 with CSS3 and JavaScript, software design, and other topics. He is regularly giving talks at user groups, conferences, and companies. He is actively contributing to open-source projects. Florian is the maintainer of AngleSharp, a completely managed browser engine.

Comments and Discussions