Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net
- Imports System
- Imports System.Xml
- Imports System.IO
- Public Class Form1
- #Region "LOADING FORM / KIỂM TRA KẾT NỐI INTERNET"
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Try
- My.Computer.Network.Ping("www.Google.com")
- Catch
- MsgBox("Kiểm tra kết nối internet của bạn." & vbNewLine & "Thông báo", MsgBoxStyle.Critical, "Error")
- End
- End Try
- TextBox1.Text = WebBrowser1.Location.ToString
- End Sub
- #End Region
- #Region "PANEL MOVING"
- Dim drag As Boolean
- Dim mousex As Integer
- Dim mousey As Integer
- Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Panel1.MouseDown
- drag = True
- mousex = Windows.Forms.Cursor.Position.X - Me.Left
- mousey = Windows.Forms.Cursor.Position.Y - Me.Top
- End Sub
- Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Panel1.MouseMove
- If drag Then
- Me.Top = Windows.Forms.Cursor.Position.Y - mousey
- Me.Left = Windows.Forms.Cursor.Position.X - mousex
- End If
- End Sub
- Private Sub Panel1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Panel1.MouseUp
- drag = False
- End Sub
- #End Region
- Private Sub Label1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Label1.MouseDown
- drag = True 'Sets the variable drag to true.
- mousex = Windows.Forms.Cursor.Position.X - Me.Left 'Sets variable mousex
- mousey = Windows.Forms.Cursor.Position.Y - Me.Top 'Sets variable mousey
- End Sub
- Private Sub Label1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Label1.MouseMove
- If drag Then
- Me.Top = Windows.Forms.Cursor.Position.Y - mousey
- Me.Left = Windows.Forms.Cursor.Position.X - mousex
- End If
- End Sub
- Private Sub Label1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Label1.MouseUp
- drag = False
- End Sub
- Private Sub Button1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Button1.Paint
- Dim Btn = DirectCast(sender, Button)
- Using P As New Pen(Me.BackColor)
- e.Graphics.DrawRectangle(P, 1, 1, Btn.Width - 3, Btn.Height - 3)
- End Using
- Button1.FlatAppearance.BorderSize = 0
- End Sub
- Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
- End
- End Sub
- Private Sub Button2_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Button2.Paint
- Dim Btn = DirectCast(sender, Button)
- Using P As New Pen(Me.BackColor)
- e.Graphics.DrawRectangle(P, 1, 1, Btn.Width - 3, Btn.Height - 3)
- End Using
- Button2.FlatAppearance.BorderSize = 0
- End Sub
- Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
- Me.WindowState = FormWindowState.Minimized
- End Sub
- ' Private Sub MinimizeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles MinimizeToolStripMenuItem.Click
- ' Me.WindowState = FormWindowState.Minimized
- 'End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement