Page 1 of 1

Make your Borderless own Design/Form!

Posted: Fri Aug 20, 2010 7:51 pm
by domipoppe
Ok hello, to the beginning of the Tutorial, i want to say: "Dont make Mirrors, or anyone!", and i am german and i cant speak so nice english cryer;

We make: Minimize Form, Maximaze Form and Move Form cooll;

You need:
A Picturebox, and 2 Buttons! (For the 2 Buttons you can also take 2 Pictureboxes against!)

First one, make a new Project, and go to Properties window under to "Form Border Style" there you choise "None"

Image

If you done that, you must to insert a picture in the picturebox, i choose an nice style (Is in the download included)
Now, choose on Size Mod "Stretch"...

Image

Image

Now dock the Picturebox1 on the Head (See on picture)

Image

Choose the Size, now the came to the code!

By Button1 you type the Code: (Minimize Button)
Code: Select all
Me.WindowState = FormWindowState.Minimized
By Button2 you type the Code: (Close Button)
Code: Select all
Me.Close
Now go on the head of the code and insert following under Public Class Form1:
Code: Select all
Private _move As Boolean = False
Dim differencePoint As New Point
Now click on the Picturebox1, and choose above the Properties windows "Events"

Image

Scroll down and select Mouse Down and make an doubleclick on it there you write following code:
Code: Select all
_move = True
differencePoint = e.Location
Now, you go against to the Events windows, and search for: "MouseMove" there you write following code:
Code: Select all
If _move Then
Dim newX As Int32 = (Me.Location.X - differencePoint.X) + (e.X)
Dim newY As Int32 = (Me.Location.Y - differencePoint.Y) + (e.Y)
Me.Location = New Point(newX, newY)
End If
At the last step, you search "MouseUp" there you write following Code:
Code: Select all
_move = False
So the Result is:
Image

Re: Make your Borderless own Design/Form!

Posted: Fri Aug 20, 2010 8:24 pm
by XTechVB
hmmm simple but is very useful for beginners. moving a borderless form is still a frequently asked question.
you did good for your first tutorial

Re: Make your Borderless own Design/Form!

Posted: Fri Aug 20, 2010 9:00 pm
by domipoppe
thanks ;-D

Re: Make your Borderless own Design/Form!

Posted: Sat Aug 21, 2010 3:57 am
by zachman61
good job cooll;
good tutorial and still asked alot about

Re: Make your Borderless own Design/Form!

Posted: Fri Sep 03, 2010 4:34 pm
by domipoppe
@zachman61
thanks, well i think the first time, o i hope the tutorial is good ;-D

Re: Make your Borderless own Design/Form!

Posted: Fri Sep 03, 2010 8:21 pm
by Axel
you could place ur anchor on top so you don't have to dock it :D

Re: Make your Borderless own Design/Form!

Posted: Fri Sep 03, 2010 8:23 pm
by Cheatmasterbw
cool! is there a way to apply the aero snap feature? (for Win7)

Re: Make your Borderless own Design/Form!

Posted: Fri Sep 03, 2010 8:28 pm
by Axel
Cheatmasterbw wrote:
cool! is there a way to apply the aero snap feature? (for Win7)
i guess you should use the way almost everyone uses but instead of "form1.backcolor = black " i would use panel.backcolor