Menggerakkan Form Tanpa Border
Berikut cara untuk menggerakkan Form yang sengaja tanpa / tidak diberi border.
[ VB 6.0 ]
Di bagian 'Form_MouseMove' ketikkan :
If Me.WindowState <> 0 Then Exit Sub
Static l As Integer, t As Integer
If Button = 1 Then
Me.Left = (Me.Left + X) - l
Me.Top = (Me.Top + Y) - t
Else
l = X
t = Y
End If
Static l As Integer, t As Integer
If Button = 1 Then
Me.Left = (Me.Left + X) - l
Me.Top = (Me.Top + Y) - t
Else
l = X
t = Y
End If
[ VB .NET ]
Di bagian 'Form1_MouseMove' ketikkan :
If Me.WindowState <> FormWindowState.Normal Then Exit Sub
Static p As Point
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Left = (Me.Left + e.X) - p.X
Me.Top = (Me.Top + e.Y) - p.Y
Else
p = e.Location
End If
Static p As Point
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Left = (Me.Left + e.X) - p.X
Me.Top = (Me.Top + e.Y) - p.Y
Else
p = e.Location
End If
1 Komentar:
cek komentar
Posting Komentar
Pengunjung yang baik selalu meninggalkan jejak berupa komentar. :)
Berlangganan Posting Komentar [Atom]
<< Beranda