Click here to Skip to main content
11,408,835 members (61,360 online)
Click here to Skip to main content
Articles » Languages » VB.NET » Windows Forms » Downloads
Add your own
alternative version

Drag and Resize - Borderless Form

, 17 Dec 2012 CPOL
This code allows to drag and resize a borderless form!
csharp-borderless_form-noexe.zip
Borderless Form
Borderless Form
bin
Release
Borderless Form.vshost.exe.manifest
Properties
Settings.settings
Resources
close2.bmp
maximize2.bmp
minimize2.bmp
Orange.bmp
Borderless Form.suo
csharp-borderless_form.zip
Debug
Borderless Form.exe
Borderless Form.pdb
Borderless Form.vshost.exe
Borderless Form.exe
Borderless Form.pdb
Borderless Form.vshost.exe
Borderless Form.vshost.exe.manifest
obj
x86
Debug
Borderless Form.exe
Borderless Form.pdb
Borderless_Form.Borderless.resources
Borderless_Form.Properties.Resources.resources
DesignTimeResolveAssemblyReferencesInput.cache
GenerateResource-ResGen.read.1.tlog
GenerateResource-ResGen.read.6.tlog
GenerateResource-ResGen.write.1.tlog
TempPE
Properties.Resources.Designer.cs.dll
Release
Borderless Form.exe
Borderless Form.pdb
Borderless_Form.Borderless.resources
Borderless_Form.Properties.Resources.resources
DesignTimeResolveAssemblyReferencesInput.cache
GenerateResource-ResGen.read.1.tlog
GenerateResource-ResGen.read.6.tlog
GenerateResource-ResGen.write.1.tlog
TempPE
Properties.Resources.Designer.cs.dll
Settings.settings
close2.bmp
maximize2.bmp
minimize2.bmp
Orange.bmp
Borderless Form.suo
VB-Borderless_Form-noexe.zip
Borderless Form.vshost.exe.manifest
My Project
Application.myapp
Settings.settings
close2.bmp
maximize2.bmp
minimize2.bmp
Orange.bmp
Borderless Form.suo
vb-borderless_form.zip
Borderless Form.exe
Borderless Form.pdb
Borderless Form.vshost.exe
Borderless Form.exe
Borderless Form.pdb
Borderless Form.vshost.exe
Borderless Form.vshost.exe.manifest
Application.myapp
Settings.settings
Borderless Form.exe
Borderless Form.pdb
Borderless_Form.Borderless.resources
Borderless_Form.Resources.resources
DesignTimeResolveAssemblyReferencesInput.cache
GenerateResource-ResGen.read.1.tlog
GenerateResource-ResGen.read.4.tlog
GenerateResource-ResGen.write.1.tlog
My Project.Resources.Designer.vb.dll
Borderless Form.exe
Borderless Form.pdb
Borderless_Form.Borderless.resources
Borderless_Form.Resources.resources
DesignTimeResolveAssemblyReferencesInput.cache
GenerateResource-ResGen.read.1.tlog
GenerateResource-ResGen.read.4.tlog
GenerateResource-ResGen.write.1.tlog
My Project.Resources.Designer.vb.dll
close2.bmp
maximize2.bmp
minimize2.bmp
Orange.bmp
Borderless Form.suo
namespace Borderless_Form
{
    partial class Borderless
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (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.components = new System.ComponentModel.Container();
            this.panel1 = new System.Windows.Forms.Panel();
            this.labelName = new System.Windows.Forms.Label();
            this.buttonMin = new System.Windows.Forms.Button();
            this.buttonClos = new System.Windows.Forms.Button();
            this.buttonMax = new System.Windows.Forms.Button();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // panel1
            // 
            this.panel1.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.panel1.BackgroundImage = global::Borderless_Form.Properties.Resources.Orange;
            this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.panel1.Controls.Add(this.labelName);
            this.panel1.Controls.Add(this.buttonMin);
            this.panel1.Controls.Add(this.buttonClos);
            this.panel1.Controls.Add(this.buttonMax);
            this.panel1.Location = new System.Drawing.Point(3, 3);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(444, 26);
            this.panel1.TabIndex = 3;
            this.panel1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDoubleClick);
            this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
            this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
            this.panel1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseUp);
            // 
            // labelName
            // 
            this.labelName.AutoSize = true;
            this.labelName.BackColor = System.Drawing.Color.Transparent;
            this.labelName.Font = new System.Drawing.Font("Georgia", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
            this.labelName.Location = new System.Drawing.Point(9, 6);
            this.labelName.Name = "labelName";
            this.labelName.Size = new System.Drawing.Size(106, 15);
            this.labelName.TabIndex = 4;
            this.labelName.Text = "Selfmade Form";
            // 
            // buttonMin
            // 
            this.buttonMin.BackgroundImage = global::Borderless_Form.Properties.Resources.minimize2;
            this.buttonMin.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.buttonMin.Location = new System.Drawing.Point(370, 3);
            this.buttonMin.Name = "buttonMin";
            this.buttonMin.Size = new System.Drawing.Size(20, 20);
            this.buttonMin.TabIndex = 2;
            this.buttonMin.UseVisualStyleBackColor = true;
            this.buttonMin.Click += new System.EventHandler(this.buttonMin_Click);
            // 
            // buttonClos
            // 
            this.buttonClos.BackgroundImage = global::Borderless_Form.Properties.Resources.close2;
            this.buttonClos.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.buttonClos.Location = new System.Drawing.Point(422, 3);
            this.buttonClos.Name = "buttonClos";
            this.buttonClos.Size = new System.Drawing.Size(20, 20);
            this.buttonClos.TabIndex = 0;
            this.buttonClos.UseVisualStyleBackColor = true;
            this.buttonClos.Click += new System.EventHandler(this.buttonClos_Click);
            // 
            // buttonMax
            // 
            this.buttonMax.BackgroundImage = global::Borderless_Form.Properties.Resources.maximize2;
            this.buttonMax.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
            this.buttonMax.Location = new System.Drawing.Point(396, 3);
            this.buttonMax.Name = "buttonMax";
            this.buttonMax.Size = new System.Drawing.Size(20, 20);
            this.buttonMax.TabIndex = 1;
            this.buttonMax.UseVisualStyleBackColor = true;
            this.buttonMax.Click += new System.EventHandler(this.buttonMax_Click);
            // 
            // timer1
            // 
            this.timer1.Enabled = true;
            this.timer1.Interval = 50;
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            // 
            // Borderless
            // 
            this.ClientSize = new System.Drawing.Size(449, 210);
            this.Controls.Add(this.panel1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Name = "Borderless";
            this.Text = "Selfmade Form";
            this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Borderless_MouseDown);
            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Borderless_MouseMove);
            this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Borderless_MouseUp);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Button buttonClos;
        private System.Windows.Forms.Button buttonMax;
        private System.Windows.Forms.Button buttonMin;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label labelName;
        private System.Windows.Forms.Timer timer1;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author


| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150414.5 | Last Updated 18 Dec 2012
Article Copyright 2012 by bEGI23
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid