Recursively load Directory info into TreeView

image_pdfimage_print


   


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

public class Form1 : Form
{
      private System.Windows.Forms.TreeView directoryTreeView;
     
      string substringDirectory;
       
      public Form1() {
        InitializeComponent();
        directoryTreeView.Nodes.Clear();
        
        String path = "c:Temp";

        directoryTreeView.Nodes.Add( path );
        PopulateTreeView(path, directoryTreeView.Nodes[ 0 ] );
      }  

      public void PopulateTreeView(string directoryValue, TreeNode parentNode )
      {
          string[] directoryArray = 
           Directory.GetDirectories( directoryValue );

          try
          {
             if ( directoryArray.Length != 0 )
             {
                foreach ( string directory in directoryArray )
                {
                  substringDirectory = directory.Substring(
                  directory.LastIndexOf( '' ) + 1,
                  directory.Length - directory.LastIndexOf( '' ) - 1 );

                  TreeNode myNode = new TreeNode( substringDirectory );

                  parentNode.Nodes.Add( myNode );

                  PopulateTreeView( directory, myNode );
               }
             }
          } catch ( UnauthorizedAccessException ) {
            parentNode.Nodes.Add( "Access denied" );
          } // end catch
      }

      private void InitializeComponent()
      {
         this.directoryTreeView = new System.Windows.Forms.TreeView();
         this.SuspendLayout();
         // 
         // directoryTreeView
         // 
         this.directoryTreeView.Location = new System.Drawing.Point(12, 77);
         this.directoryTreeView.Name = "directoryTreeView";
         this.directoryTreeView.Size = new System.Drawing.Size(284, 265);
         this.directoryTreeView.TabIndex = 0;
         // 
         // TreeViewDirectoryStructureForm
         // 
         this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
         this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
         this.ClientSize = new System.Drawing.Size(304, 354);
         this.Controls.Add(this.directoryTreeView);
         this.Name = "TreeViewDirectoryStructureForm";
         this.Text = "TreeViewDirectoryStructure";
         this.ResumeLayout(false);
         this.PerformLayout();

      }
  [STAThread]
  static void Main()
  {
    Application.EnableVisualStyles();
    Application.Run(new Form1());
  }

}


           
          


Drag and drop Tree Node

image_pdfimage_print


   


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

public class Form1 : Form
{
  private System.Windows.Forms.SplitContainer splitContainer1;
  private System.Windows.Forms.TreeView treeOne;
  private System.Windows.Forms.TreeView treeTwo;
  public Form1() {
        InitializeComponent();
    TreeNode node = treeOne.Nodes.Add("A");
    node.Nodes.Add("A1");
    node.Nodes.Add("A2");
    node.Expand();

    node = treeTwo.Nodes.Add("B");
    node.Nodes.Add("B1");
    node.Nodes.Add("B2");
    node.Expand();

    treeTwo.AllowDrop = true;
    treeOne.AllowDrop = true;

  }
  private void tree_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
  {
    TreeView tree = (TreeView)sender;
    TreeNode node = tree.GetNodeAt(e.X, e.Y);
    tree.SelectedNode = node;

    if (node != null)
    {
      tree.DoDragDrop(node, DragDropEffects.Copy);
    }
  }
  private void tree_DragOver(object sender, System.Windows.Forms.DragEventArgs e)
  {
    TreeView tree = (TreeView)sender;

    e.Effect = DragDropEffects.None;

    TreeNode nodeSource = (TreeNode)e.Data.GetData(typeof(TreeNode));
    if (nodeSource != null)
    {
      if (nodeSource.TreeView != tree)
      {
        Point pt = new Point(e.X, e.Y);
        pt = tree.PointToClient(pt);
        TreeNode nodeTarget = tree.GetNodeAt(pt);
        if (nodeTarget != null)
        {
          e.Effect = DragDropEffects.Copy;
          tree.SelectedNode = nodeTarget;
        }
      }
    }
  }
  private void tree_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
  {
    TreeView tree = (TreeView)sender;
    Point pt = new Point(e.X, e.Y);
    pt = tree.PointToClient(pt);
    TreeNode nodeTarget = tree.GetNodeAt(pt);
    TreeNode nodeSource = (TreeNode)e.Data.GetData(typeof(TreeNode));
    nodeTarget.Nodes.Add((TreeNode)nodeSource.Clone());
    nodeTarget.Expand();
  }

  private void InitializeComponent()
  {
        this.splitContainer1 = new System.Windows.Forms.SplitContainer();
        this.treeOne = new System.Windows.Forms.TreeView();
        this.treeTwo = new System.Windows.Forms.TreeView();
        this.splitContainer1.Panel1.SuspendLayout();
        this.splitContainer1.Panel2.SuspendLayout();
        this.splitContainer1.SuspendLayout();
        this.SuspendLayout();
        // 
        // splitContainer1
        // 
        this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
        this.splitContainer1.Location = new System.Drawing.Point(0, 0);
        this.splitContainer1.Name = "splitContainer1";
        // 
        // splitContainer1.Panel1
        // 
        this.splitContainer1.Panel1.Controls.Add(this.treeOne);
        // 
        // splitContainer1.Panel2
        // 
        this.splitContainer1.Panel2.Controls.Add(this.treeTwo);
        this.splitContainer1.Size = new System.Drawing.Size(456, 391);
        this.splitContainer1.SplitterDistance = 238;
        this.splitContainer1.TabIndex = 0;
        this.splitContainer1.Text = "splitContainer1";
        // 
        // treeOne
        // 
        this.treeOne.Dock = System.Windows.Forms.DockStyle.Left;
        this.treeOne.HideSelection = false;
        this.treeOne.Location = new System.Drawing.Point(0, 0);
        this.treeOne.Name = "treeOne";
        this.treeOne.Size = new System.Drawing.Size(236, 391);
        this.treeOne.TabIndex = 5;
        this.treeOne.DragDrop += new System.Windows.Forms.DragEventHandler(this.tree_DragDrop);
        this.treeOne.DragOver += new System.Windows.Forms.DragEventHandler(this.tree_DragOver);
        this.treeOne.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tree_MouseDown);
        // 
        // treeTwo
        // 
        this.treeTwo.Dock = System.Windows.Forms.DockStyle.Fill;
        this.treeTwo.Location = new System.Drawing.Point(0, 0);
        this.treeTwo.Name = "treeTwo";
        this.treeTwo.Size = new System.Drawing.Size(214, 391);
        this.treeTwo.TabIndex = 7;
        this.treeTwo.DragDrop += new System.Windows.Forms.DragEventHandler(this.tree_DragDrop);
        this.treeTwo.DragOver += new System.Windows.Forms.DragEventHandler(this.tree_DragOver);
        this.treeTwo.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tree_MouseDown);
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(456, 391);
        this.Controls.Add(this.splitContainer1);
        this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
        this.Name = "Form1";
        this.Text = "TreeView Drag-And-Drop";
        this.splitContainer1.Panel1.ResumeLayout(false);
        this.splitContainer1.Panel2.ResumeLayout(false);
        this.splitContainer1.ResumeLayout(false);
        this.ResumeLayout(false);

  }

  [STAThread]
  static void Main()
  {
    Application.EnableVisualStyles();
    Application.Run(new Form1());
  }

}


           
          


Use TrackBar to control label color

image_pdfimage_print


   


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

  public class TrackForm : System.Windows.Forms.Form
  {
    private System.Windows.Forms.Label label4;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TrackBar blueTrackBar;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.TrackBar greenTrackBar;
    private System.Windows.Forms.TrackBar redTrackBar;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.Panel panel1;
    private System.Windows.Forms.Label lblCurrColor;
    private System.Windows.Forms.PictureBox colorBox;

    public TrackForm()
    {
      InitializeComponent();
      CenterToScreen();         
  
      redTrackBar.Value = 0;
      greenTrackBar.Value = 0;
      blueTrackBar.Value = 0;
      UpdateColor();
    }
    private void InitializeComponent()
    {
      this.label4 = new System.Windows.Forms.Label ();
      this.label1 = new System.Windows.Forms.Label ();
      this.label3 = new System.Windows.Forms.Label ();
      this.label2 = new System.Windows.Forms.Label ();
      this.panel1 = new System.Windows.Forms.Panel ();
      this.redTrackBar = new System.Windows.Forms.TrackBar ();
      this.greenTrackBar = new System.Windows.Forms.TrackBar ();
      this.colorBox = new System.Windows.Forms.PictureBox ();
      this.lblCurrColor = new System.Windows.Forms.Label ();
      this.blueTrackBar = new System.Windows.Forms.TrackBar ();
      redTrackBar.BeginInit ();
      greenTrackBar.BeginInit ();
      blueTrackBar.BeginInit ();

      label4.Location = new System.Drawing.Point (16, 88);
      label4.Text = "Pick your slider here:";
      label4.Size = new System.Drawing.Size (240, 32);
      label4.Font = new System.Drawing.Font ("Microsoft Sans Serif", 15);
      label4.TabIndex = 9;
      label1.Location = new System.Drawing.Point (24, 16);
      label1.Text = "Red:";
      label1.Size = new System.Drawing.Size (88, 32);
      label1.Font = new System.Drawing.Font ("Arial", 15);
      label1.TabIndex = 4;
      label3.Location = new System.Drawing.Point (24, 104);
      label3.Text = "Blue:";
      label3.Size = new System.Drawing.Size (88, 32);
      label3.Font = new System.Drawing.Font ("Arial", 15);
      label3.TabIndex = 6;
      label2.Location = new System.Drawing.Point (24, 64);
      label2.Text = "Green:";
      label2.Size = new System.Drawing.Size (88, 32);
      label2.Font = new System.Drawing.Font ("Arial", 15);
      label2.TabIndex = 5;
      panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
      panel1.Location = new System.Drawing.Point (16, 120);
      panel1.Size = new System.Drawing.Size (384, 188);
      panel1.TabIndex = 8;
      panel1.AutoScroll = true;
      redTrackBar.TickFrequency = 5;
      redTrackBar.Location = new System.Drawing.Point (120, 16);
      redTrackBar.TabIndex = 2;
      redTrackBar.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
      redTrackBar.Maximum = 255;
      redTrackBar.Size = new System.Drawing.Size (232, 42);
      redTrackBar.Scroll += new System.EventHandler (this.redTrackBar_Scroll);
      greenTrackBar.TickFrequency = 5;
      greenTrackBar.Location = new System.Drawing.Point (120, 56);
      greenTrackBar.TabIndex = 3;
      greenTrackBar.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
      greenTrackBar.Maximum = 255;
      greenTrackBar.Size = new System.Drawing.Size (240, 42);
      greenTrackBar.Scroll += new System.EventHandler (this.greenTrackBar_Scroll);
      colorBox.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
      colorBox.BackColor = System.Drawing.Color.Blue;
      colorBox.Location = new System.Drawing.Point (16, 16);
      colorBox.Size = new System.Drawing.Size (384, 56);
      colorBox.TabIndex = 0;
      colorBox.TabStop = false;
      lblCurrColor.Location = new System.Drawing.Point (16, 324);
      lblCurrColor.Text = "label4";
      lblCurrColor.Size = new System.Drawing.Size (392, 40);
      lblCurrColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
      lblCurrColor.Font = new System.Drawing.Font ("Microsoft Sans Serif", 14);
      lblCurrColor.TabIndex = 7;
      blueTrackBar.TickFrequency = 5;
      blueTrackBar.Location = new System.Drawing.Point (120, 96);
      blueTrackBar.TabIndex = 1;
      blueTrackBar.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
      blueTrackBar.Maximum = 255;
      blueTrackBar.Size = new System.Drawing.Size (240, 42);
      blueTrackBar.Scroll += new System.EventHandler (this.blueTrackBar_Scroll);
      this.Text = "Color Form";
      this.AutoScaleBaseSize = new System.Drawing.Size (5, 13);
      this.ClientSize = new System.Drawing.Size (424, 385);
      panel1.Controls.Add (this.label2);
      panel1.Controls.Add (this.blueTrackBar);
      panel1.Controls.Add (this.label3);
      panel1.Controls.Add (this.greenTrackBar);
      panel1.Controls.Add (this.redTrackBar);
      panel1.Controls.Add (this.label1);
      this.Controls.Add (this.label4);
      this.Controls.Add (this.panel1);
      this.Controls.Add (this.lblCurrColor);
      this.Controls.Add (this.colorBox);
      redTrackBar.EndInit ();
      greenTrackBar.EndInit ();
      blueTrackBar.EndInit ();
    }
    static void Main() 
    {
      Application.Run(new TrackForm());
    }

    protected void greenTrackBar_Scroll (object sender, System.EventArgs e)
    {
      UpdateColor();
    }

    protected void redTrackBar_Scroll (object sender, System.EventArgs e)
    {
      UpdateColor();
    }

    protected void blueTrackBar_Scroll (object sender, System.EventArgs e)
    {
      UpdateColor();
    }

    private void UpdateColor()
    {
      Color c = Color.FromArgb(redTrackBar.Value, greenTrackBar.Value, blueTrackBar.Value);
      colorBox.BackColor = c;

      lblCurrColor.Text = "Current color is: " + "(" + 
        redTrackBar.Value + ", " + 
        greenTrackBar.Value + " ," +  
        blueTrackBar.Value + ")";
    }
  }


           
          


Tooltips for Button

image_pdfimage_print


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

public class Tooltips : System.Windows.Forms.Form {
    private System.Windows.Forms.Button btnTooltips;
    private System.Windows.Forms.TextBox txtTooltip;
    public Tooltips() {
        ToolTip forButton = new ToolTip();
        forButton.SetToolTip(btnTooltips, "You are now over the button!!");
        forButton.SetToolTip(txtTooltip, "You are now over the textbox!!");
        forButton.AutomaticDelay = 2000;
        this.btnTooltips = new System.Windows.Forms.Button();
        this.txtTooltip = new System.Windows.Forms.TextBox();
        this.SuspendLayout();

        this.btnTooltips.Location = new System.Drawing.Point(0, 152);
        this.btnTooltips.Size = new System.Drawing.Size(288, 104);
        this.btnTooltips.Text = "Press Me";

        this.txtTooltip.Location = new System.Drawing.Point(0, 8);
        this.txtTooltip.Multiline = true;
        this.txtTooltip.Size = new System.Drawing.Size(288, 136);
        this.txtTooltip.Text = "";

        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.ClientSize = new System.Drawing.Size(292, 266);
        this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                      this.txtTooltip,
                                      this.btnTooltips});
        this.ResumeLayout(false);

    }
    [STAThread]
    static void Main() {
        Application.Run(new Tooltips());
    }
}

    


Tooltips Demo

image_pdfimage_print


   

/*
Professional Windows GUI Programming Using C#
by Jay Glynn, Csaba Torok, Richard Conway, Wahid Choudhury, 
   Zach Greenvoss, Shripad Kulkarni, Neil Whitlow

Publisher: Peer Information
ISBN: 1861007663
*/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace Tooltips
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public class Tooltips : System.Windows.Forms.Form
    {
        private System.Windows.Forms.Button btnTooltips;
        private System.Windows.Forms.TextBox txtTooltip;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public Tooltips()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            ToolTip forButton = new ToolTip();
            forButton.SetToolTip(btnTooltips, "You are now over the button!!");
            forButton.SetToolTip(txtTooltip, "You are now over the textbox!!");
            forButton.AutomaticDelay = 2000;
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if (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()
        {
            this.btnTooltips = new System.Windows.Forms.Button();
            this.txtTooltip = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            // 
            // btnTooltips
            // 
            this.btnTooltips.Location = new System.Drawing.Point(0, 152);
            this.btnTooltips.Name = "btnTooltips";
            this.btnTooltips.Size = new System.Drawing.Size(288, 104);
            this.btnTooltips.TabIndex = 0;
            this.btnTooltips.Text = "Press Me";
            // 
            // txtTooltip
            // 
            this.txtTooltip.Location = new System.Drawing.Point(0, 8);
            this.txtTooltip.Multiline = true;
            this.txtTooltip.Name = "txtTooltip";
            this.txtTooltip.Size = new System.Drawing.Size(288, 136);
            this.txtTooltip.TabIndex = 1;
            this.txtTooltip.Text = "";
            // 
            // Tooltips
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(292, 266);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                          this.txtTooltip,
                                                                          this.btnTooltips});
            this.Name = "Tooltips";
            this.Text = "Tooltips";
            this.ResumeLayout(false);

        }
        #endregion

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() 
        {
            Application.Run(new Tooltips());
        }
    }
}


           
          


Add icon to Tooltip

image_pdfimage_print


   


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

public class Form1 : Form
{
  private System.Windows.Forms.PictureBox pictureBox1;
  private System.Windows.Forms.ToolTip toolTip1;
  private System.Windows.Forms.ToolTip toolTip2;
  private System.Windows.Forms.PictureBox pictureBox2;

  public Form1() {
        InitializeComponent();
  }

  private void InitializeComponent()
  {
        this.pictureBox1 = new System.Windows.Forms.PictureBox();
        this.toolTip1 = new System.Windows.Forms.ToolTip(new System.ComponentModel.Container());
        this.toolTip2 = new System.Windows.Forms.ToolTip(new System.ComponentModel.Container());
        this.pictureBox2 = new System.Windows.Forms.PictureBox();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
        this.SuspendLayout();
        // 
        // pictureBox1
        // 
        this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        this.pictureBox1.Location = new System.Drawing.Point(12, 24);
        this.pictureBox1.Name = "pictureBox1";
        this.pictureBox1.Size = new System.Drawing.Size(100, 50);
        this.pictureBox1.TabIndex = 0;
        this.pictureBox1.TabStop = false;
        this.toolTip1.SetToolTip(this.pictureBox1, "This is a tooltip.");
        // 
        // toolTip1
        // 
        this.toolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
        this.toolTip1.ToolTipTitle = "Titled ToolTip";
        // 
        // pictureBox2
        // 
        this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        this.pictureBox2.Location = new System.Drawing.Point(148, 24);
        this.pictureBox2.Name = "pictureBox2";
        this.pictureBox2.Size = new System.Drawing.Size(100, 50);
        this.pictureBox2.TabIndex = 1;
        this.pictureBox2.TabStop = false;
        this.toolTip2.SetToolTip(this.pictureBox2, "This is a tooltip.");
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(279, 107);
        this.Controls.Add(this.pictureBox2);
        this.Controls.Add(this.pictureBox1);
        this.Name = "Form1";
        this.Text = "ToolTip Test";
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
        this.ResumeLayout(false);

  }
  [STAThread]
  static void Main()
  {
    Application.EnableVisualStyles();
    Application.Run(new Form1());
  }

}


           
          


Add Tooltip to a component

image_pdfimage_print


   

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

public class Form1 : Form
{
  private System.Windows.Forms.PictureBox pictureBox1;
  private System.Windows.Forms.ToolTip toolTip1;
  private System.Windows.Forms.ToolTip toolTip2;
  private System.Windows.Forms.PictureBox pictureBox2;

  public Form1() {
        InitializeComponent();
  }

  private void InitializeComponent()
  {
        this.pictureBox1 = new System.Windows.Forms.PictureBox();
        this.toolTip1 = new System.Windows.Forms.ToolTip(new System.ComponentModel.Container());
        this.toolTip2 = new System.Windows.Forms.ToolTip(new System.ComponentModel.Container());
        this.pictureBox2 = new System.Windows.Forms.PictureBox();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
        this.SuspendLayout();
        // 
        // pictureBox1
        // 
        this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        this.pictureBox1.Location = new System.Drawing.Point(12, 24);
        this.pictureBox1.Name = "pictureBox1";
        this.pictureBox1.Size = new System.Drawing.Size(100, 50);
        this.pictureBox1.TabIndex = 0;
        this.pictureBox1.TabStop = false;
        this.toolTip1.SetToolTip(this.pictureBox1, "This is a tooltip.");
        // 
        // toolTip1
        // 
        this.toolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
        this.toolTip1.ToolTipTitle = "Titled ToolTip";
        // 
        // pictureBox2
        // 
        this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
        this.pictureBox2.Location = new System.Drawing.Point(148, 24);
        this.pictureBox2.Name = "pictureBox2";
        this.pictureBox2.Size = new System.Drawing.Size(100, 50);
        this.pictureBox2.TabIndex = 1;
        this.pictureBox2.TabStop = false;
        this.toolTip2.SetToolTip(this.pictureBox2, "This is a tooltip.");
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(279, 107);
        this.Controls.Add(this.pictureBox2);
        this.Controls.Add(this.pictureBox1);
        this.Name = "Form1";
        this.Text = "ToolTip Test";
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
        ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
        this.ResumeLayout(false);

  }
  [STAThread]
  static void Main()
  {
    Application.EnableVisualStyles();
    Application.Run(new Form1());
  }

}