Xu Changyou travels online as an irregular form involves an API call and a lot of programming, it is a very complicated thing. Below we can use Borland C # Builder to easily implement an irregular form, with an example to describe its production process below. I. Prepare an irregular form bit Figure 2. The setting of the form is 3. The completion of the code. Prepare an irregular form bitmap For convenience, we will find a few other Skin. Here, Skins / Ocean / KingDVD_Disable.bmp under the installation directory of Jinshan Pilot 2003 is of course you can use the drawing tool, making a shape-shaped bitmap, a special color, such as white. This color will be used later.
[Related map]
II. Setting of the form 1. New C # Application
[Related map]
2. Check the new form to set its corresponding attribute: (1). Set the FormBorderstyle property to None. (2). Set the form's BackgroundImage property to the first bitmap file. (3). Set the TRANSPARENCYKEY attribute to the background color of the bitmap file, in this case. (This property tells which parts in the application form need to be set to transparency.) (4). Add a PictureBox1, just turn off the bitmap and turn off the application when clicking. (5). Add a contextMenu1 to add a menu item "Exit", set the winform's ContextMenu to ContextMenu1. Press F9 to run your program, you can see your irregular form.
[Related map]
3. The window that does not move before the code is completed.
Add the following code to move it, post the complete sample code: use system; using system.drawing; use system.collections; using system.componentmodel; using system.windows.forms; using system.data; namespace sform { ///
// // contextMenu1 // this.contextMenu1.Menuitems.addrange (new system.windows.Forms.Menuitem [] {this.Menuitem1}); // // Menuitem1 // this.Menuitem1.index = 0; this.Menuitem1 .Text = "Exit"; this.Menuitem1.click = new system.EventHandler (this.Menuitem1_click); // // PictureBox1 // this.PictureBox1.image = ((System.drawing.Image) (Resources.GetObject "pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point (290, 8); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size ( 14, 13); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; this.pictureBox1.Click = new System.EventHandler (this .pictureBox1_Click); // // WinForm // this.AutoScaleBaseSize = new System.Drawing.Size (6, 14); this.BackgroundImage = ((System.Drawing.Image) (resources.GetObject ( "$ this.BackgroundImage" )))))); This.clientsize = new System.Drawing.Size (365, 235); this.ContextMenu = this.contextMenu1; this.Controls.Add (this.pictureBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.MaximizeBox = false ; this.MinimizeBox = false; this.Name = "WinForm"; this.Text = "WinForm"; this.TransparencyKey = System.Drawing.Color.White; this.MouseDown = new System.Windows.Forms.MouseEventHandler (this .Winform_mousedown; this.mouseup = new system.windows.Forms.MouseEventHandler (this.mousemove =
New system.windows.Forms.MouseEventHandler (this.winform_mousemove); this.ResumeLayout (false);} #endregion ///