SHARE
TWEET

HungCoder Full Code Border :D

bomkhung92 Apr 18th, 2020 6 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Net
  2. Imports System
  3. Imports System.Xml
  4. Imports System.IO
  5.  
  6. Public Class Form1
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. #Region "LOADING FORM / KIỂM TRA KẾT NỐI INTERNET"
  14.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  15.         Try
  16.             My.Computer.Network.Ping("www.Google.com")
  17.         Catch
  18.             MsgBox("Kiểm tra kết nối internet của bạn." & vbNewLine & "Thông báo", MsgBoxStyle.Critical, "Error")
  19.             End
  20.         End Try
  21.  
  22.         TextBox1.Text = WebBrowser1.Location.ToString
  23.     End Sub
  24.  
  25. #End Region
  26.  
  27. #Region "PANEL MOVING"
  28.  
  29.     Dim drag As Boolean
  30.     Dim mousex As Integer
  31.     Dim mousey As Integer
  32.     Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Panel1.MouseDown
  33.         drag = True
  34.         mousex = Windows.Forms.Cursor.Position.X - Me.Left
  35.         mousey = Windows.Forms.Cursor.Position.Y - Me.Top
  36.     End Sub
  37.     Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Panel1.MouseMove
  38.         If drag Then
  39.             Me.Top = Windows.Forms.Cursor.Position.Y - mousey
  40.             Me.Left = Windows.Forms.Cursor.Position.X - mousex
  41.         End If
  42.  
  43.     End Sub
  44.     Private Sub Panel1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Panel1.MouseUp
  45.         drag = False
  46.     End Sub
  47. #End Region
  48.  
  49.     Private Sub Label1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Label1.MouseDown
  50.         drag = True 'Sets the variable drag to true.
  51.         mousex = Windows.Forms.Cursor.Position.X - Me.Left 'Sets variable mousex
  52.         mousey = Windows.Forms.Cursor.Position.Y - Me.Top 'Sets variable mousey
  53.     End Sub
  54.     Private Sub Label1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Label1.MouseMove
  55.         If drag Then
  56.             Me.Top = Windows.Forms.Cursor.Position.Y - mousey
  57.             Me.Left = Windows.Forms.Cursor.Position.X - mousex
  58.         End If
  59.     End Sub
  60.     Private Sub Label1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Label1.MouseUp
  61.         drag = False
  62.     End Sub
  63.     Private Sub Button1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Button1.Paint
  64.         Dim Btn = DirectCast(sender, Button)
  65.         Using P As New Pen(Me.BackColor)
  66.             e.Graphics.DrawRectangle(P, 1, 1, Btn.Width - 3, Btn.Height - 3)
  67.         End Using
  68.         Button1.FlatAppearance.BorderSize = 0
  69.     End Sub
  70.  
  71.     Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
  72.         End
  73.     End Sub
  74.  
  75.     Private Sub Button2_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Button2.Paint
  76.         Dim Btn = DirectCast(sender, Button)
  77.         Using P As New Pen(Me.BackColor)
  78.             e.Graphics.DrawRectangle(P, 1, 1, Btn.Width - 3, Btn.Height - 3)
  79.         End Using
  80.         Button2.FlatAppearance.BorderSize = 0
  81.     End Sub
  82.     Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
  83.         Me.WindowState = FormWindowState.Minimized
  84.     End Sub
  85.     ' Private Sub MinimizeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles MinimizeToolStripMenuItem.Click
  86.     '    Me.WindowState = FormWindowState.Minimized
  87.     'End Sub
  88. End Class
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top