Dotnet-StuffWorld

Friday, September 18, 2009

 

Buttons BackGroundImage




See the Following Code:

this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(51, 28);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(110, 43);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.BackColor = System.Drawing.Color.Transparent;
this.button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button2.FlatAppearance.BorderSize = 0;
this.button2.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent;
this.button2.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button2.ForeColor = System.Drawing.Color.Black;
this.button2.Location = new System.Drawing.Point(51, 97);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(110, 32);
this.button2.TabIndex = 193;
this.button2.Text = "button2";
this.button2.UseVisualStyleBackColor = false;
//
// button3
//
this.button3.BackColor = System.Drawing.Color.Transparent;
this.button3.BackgroundImage = global::ButtonsCollection.Properties.Resources.btn_add;
this.button3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button3.FlatAppearance.BorderSize = 0;
this.button3.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Gray;
this.button3.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button3.ForeColor = System.Drawing.Color.White;
this.button3.Location = new System.Drawing.Point(51, 151);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(110, 33);
this.button3.TabIndex = 194;
this.button3.Text = "button3";
this.button3.UseVisualStyleBackColor = false;
//
// button4
//
this.button4.BackColor = System.Drawing.Color.Transparent;
this.button4.BackgroundImage = global::ButtonsCollection.Properties.Resources.icon_magnifyingGlass;
this.button4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button4.FlatAppearance.BorderSize = 0;
this.button4.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
this.button4.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent;
this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button4.ForeColor = System.Drawing.Color.Black;
this.button4.Location = new System.Drawing.Point(192, 134);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(31, 50);
this.button4.TabIndex = 195;
this.button4.Text = "b4";
this.button4.TextAlign = System.Drawing.ContentAlignment.BottomRight;
this.button4.UseVisualStyleBackColor = false;

Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

Archives

April 2009   July 2009   August 2009   September 2009   September 2010   February 2011  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]