Custom FormBorderStyle

Posts 1–10 of 10 · Page 1 of 1
Custom FormBorderStyle
BTW : GUI means graphic user interface if u didnt know

u can use custom themes, or u can make ur own like i do

1. make a form

2. formborderstyle = none

3. make 4 pictureboxes, and 2 timers (a button for closing is optional)
#1 dock = top
#2 dock = bottom
#3 dock = left
#4 dock = right
timer1.interval = 1, enabled = false
timer2.interval = 2, enabled = true(only add this if your adding exit button)

4. double click form

declare mouse position and form position
Code:
 Dim loc As New Point(0, 0)
    Dim cur As New Point(0, 0)
5. add a private sub
Code:
Private Sub def()
        loc = Location
        cur = Cursor.Position
    End Sub
6. go back to design and go to picturebox1 and double click

add functions (mouseup and mousedown)

or just add this
Code:
Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown
        timer1.start()
        def()
        timer1.enabled = True
    End Sub

    Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp
        Timer1.Stop()
        def()
        timer1.enabled = False
    End Sub
after adding the picturebox.mouseup and mousedown, do this to the 3 other pictureboxes (optional)

7. go to timer1 and add this to make the form location move to mouse position
Code:
Location = loc - cur + Cursor.Position
8.Test and if working enjoy

Looks very ugly in my opinion. Id rather do a seperate theme to ensure the best quality.
Quote Originally Posted by Womanizer` View Post
Looks very ugly in my opinion. Id rather do a seperate theme to ensure the best quality.
cool.................
Quote Originally Posted by Womanizer` View Post
Looks very ugly in my opinion. Id rather do a seperate theme to ensure the best quality.
if you cant find the right theme u can always come to this.
Dude its really ugly , For cool themes use DotNetBar.dll and use StyleManager
Quote Originally Posted by wut12345 View Post
cool.................
Oh look, another spam post you made...
Quote Originally Posted by lucasheer715 View Post
if you cant find the right theme u can always come to this.
I guess it's a nooby alterative...
Quote Originally Posted by T.Vader View Post
Dude its really ugly , For cool themes use DotNetBar.dll and use StyleManager
dotnetbar is ugly too
I like it..
You dont need a timer for this, i use timers only in extreme cases
Just use mousedown & mousemove events.Here you have a example:
Under Public Class Form1
Code:
    Dim a, b As Integer
    Dim newPoint As New System.Drawing.Point()
Form1.MouseDown event:
Code:
        a = Control.MousePosition.X - Me.Location.X
        b = Control.MousePosition.Y - Me.Location.Y
Form1.MouseMove event:
Code:
        If e.Button = MouseButtons.Left Then
            newPoint = Control.MousePosition
            newPoint.X = newPoint.X - a
            newPoint.Y = newPoint.Y - b
            Me.Location = newPoint
        End If
another way to do it but it does the same thing pretty much
Quote Originally Posted by lucasheer715 View Post
another way to do it but it does the same thing pretty much
The easiest way i found is this
Code:
    Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles PictureBox1.MouseDown
        sender.Capture = False
        WndProc(Message.Create(MyBase.Handle, &HA1, 2, 0))
    End Sub
No timers or storing coordinates, just one mousedown event on the picturebox.
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us