C# Source Codes: ToolTip

Monday, December 14, 2009

ToolTip






Source Code : Form1.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ClickAndShowToolTip
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
ToolTip tooltip1 = new ToolTip();
tooltip1.Show(textBox1.Text, this, 158,69, 1000);
//tooltip1.Show(string ,IWin32Window ,int x,int y,int duration);
}
}
}



Source Code : Form1.Designer.cs

namespace ClickAndShowToolTip
{
partial class Form1
{
///
/// Required designer variable.
///

private System.ComponentModel.IContainer components = null;


protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(91, 87);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(155, 33);
this.button1.TabIndex = 0;
this.button1.Text = "Click To Show ToolTip";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 38);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(73, 13);
this.label1.TabIndex = 1;
this.label1.Text = "ToolTip Text :";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(91, 35);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(155, 20);
this.textBox1.TabIndex = 2;
this.textBox1.Text = "Enter Your Text";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.ClientSize = new System.Drawing.Size(292, 144);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "Form1";
this.Text = " Click And Show ToolTip";
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox1;
}
}





Download :

exe
http://sites.google.com/site/ogremyfiles/ClickAndShowToolTip_EXE.rar
Source Code
http://sites.google.com/site/ogremyfiles/ClickAndShowToolTip_SourceCode.rar



Designed by : Ogre