Form1.vb 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. Imports System.Net
  2. Imports System.Xml
  3. Public Class Form1
  4. Dim appPath As String = Application.StartupPath()
  5. Private IsFormBeingDragged As Boolean = False
  6. Private MouseDownX As Integer
  7. Private MouseDownY As Integer
  8. Dim z As String
  9. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  10. For counter = 10 To 90 Step +20
  11. Me.Opacity = counter / 100
  12. Me.Refresh()
  13. Threading.Thread.Sleep(50)
  14. Next
  15. Me.Opacity = 100
  16. If My.Computer.FileSystem.DirectoryExists(appPath & "\system\minecraft") = False Then
  17. My.Computer.FileSystem.CreateDirectory(appPath & "\system\minecraft")
  18. End If
  19. If My.Computer.FileSystem.DirectoryExists(appPath & "\system\temp") = False Then
  20. My.Computer.FileSystem.CreateDirectory(appPath & "\system\temp")
  21. End If
  22. If My.Computer.FileSystem.FileExists(appPath & "\system\data\flaunch.ini") = False Then
  23. Dim file As System.IO.FileStream
  24. file = System.IO.File.Create(appPath & "\system\data\flaunch.ini")
  25. file.Dispose()
  26. MsgBox("歡迎使用此啟動器,這是你首次啟動,如需教學請參閱HKWTC 論壇的教學文章,多謝。")
  27. Else
  28. End If
  29. End Sub
  30. Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseDown
  31. If e.Button = MouseButtons.Left Then
  32. IsFormBeingDragged = True
  33. MouseDownX = e.X
  34. MouseDownY = e.Y
  35. End If
  36. End Sub
  37. Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseUp
  38. If e.Button = MouseButtons.Left Then
  39. IsFormBeingDragged = False
  40. End If
  41. End Sub
  42. Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseMove
  43. If IsFormBeingDragged Then
  44. Dim temp As Point = New Point()
  45. temp.X = Me.Location.X + (e.X - MouseDownX)
  46. temp.Y = Me.Location.Y + (e.Y - MouseDownY)
  47. Me.Location = temp
  48. temp = Nothing
  49. End If
  50. End Sub
  51. Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  52. End Sub
  53. Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  54. Dim iCount As Integer
  55. For iCount = 90 To 10 Step -10
  56. Me.Opacity = iCount / 100
  57. Threading.Thread.Sleep(50)
  58. Next
  59. Me.Close()
  60. End Sub
  61. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  62. z = z + 1
  63. If z = 1 Then
  64. Me.BackgroundImage = My.Resources.BG3
  65. ElseIf z = 2 Then
  66. Me.BackgroundImage = My.Resources.BG2
  67. ElseIf z = 3 Then
  68. Me.BackgroundImage = My.Resources.BG1
  69. z = 0
  70. End If
  71. End Sub
  72. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  73. Dim Form2 As New Form2
  74. Form2.Show()
  75. End Sub
  76. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  77. Dim Form3 As New Form3
  78. Form3.Show()
  79. End Sub
  80. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  81. Dim Form5 As New Form5
  82. Form5.Show()
  83. End Sub
  84. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  85. Form6.Show()
  86. End Sub
  87. Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
  88. Form8.Show()
  89. End Sub
  90. End Class