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;

Wednesday, September 9, 2009

 

Formating Rules for Connection Strings

 The rules:

* All blank characters, except those placed within a value or within quotation marks, are ignored

* Blank characters will though affect connection pooling mechanism, pooled connections must have the EXACT same connection string

* If a semicolon (;) is part of a value it must be delimited by quotation marks (")

* Use a single-quote (') if the value begins with a double-quote (")

* Conversely, use the double quote (") if the value begins with a single quote (')

* No escape sequences are supported

* The value type is NOT relevant

* Names are case iNsEnSiTiVe

* If a KEYWORD=VALUE pair occurs more than once in the connection string, the value associated with the LAST occurrence is used

* But!... if the PROVIDER keyword occurs multiple times in the string, the FIRST occurrence is used.

* If a keyword contains an equal sign (=), it must be preceded by an additional equal sign to indicate that it is part of the keyword.


Summary:
Knowing about these basic rules will keep hard to track errors away from you. Take some time understanding these rules and a couple of minutes choosing what parameters to specify when connecting your application to the data source.
..

 

Visual C# Samples, Specifications, Quick Reference and Visual C# General FAQ

http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/2d666562-ed08-4461-bf92-7808913b4e96

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]