Hello. I am making a project in which I want the Form to hide. I use Me.Hide, but it is not working. Could you give any suggestions as to why my form still shows
Code:
Imports System
Imports System.IO
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.Hide()
Dim Sub1, sub3, sub4 As String
Dim sr As IO.StreamReader = IO.File.OpenText("finalgrades.txt")
Dim fs As New System.IO.FileStream("finalgrades.htm", IO.FileMode.Create, IO.FileAccess.Write)
Dim w As New StreamWriter(fs)
Dim myinput As String
w.WriteLine("<html><body>")
w.WriteLine("<h1>Blake Holsey High School</h1><p>Phone number:845-865-3234<p><p>Adress: 324 Wormhole Road, Ontario ,Canada</p><p>Principal: Amanda Durst </p>")
w.WriteLine("</body></html>")
w.WriteLine("<html><body><table border=""3""><tr>")
w.WriteLine("<h4>Grading information:</h4><table border=""3""><tr><th>Name</th><th colspan='2'>Current Grade </th> <th colspan='3'>Percentagelevel</th><th colspan='4'>New Grade</th></tr><tr></tr>")
Do While sr.Peek <> -1
myinput = sr.ReadLine
Loop
Dim Name, lettergrade, Satisfactory, Outcome As String
lettergrade = GetGrade(sub3)
Name = Sub1
Outcome = sub4
w.WriteLine("<tr><td>" & Name & "</td><td>" & "<tr><td>" & lettergrade & "</td><td>" & "<tr><td>" & Satisfactory & "</td><td>" & "<tr><td>" & Outcome & "</td><td>")
w.WriteLine("</table></body></html>")
w.Close()
MsgBox("Your file is ready")
Me.Close()
End Sub
Function GetGrade(ByVal lettergrade As Double) As String
Dim Newlevel As String
Dim sub4 As Double
If lettergrade >= 70 Then
If sub4 = "Freshman" Then
Newlevel = "Sohpmore"
ElseIf sub4 = "Sohpmore" Then
ElseIf sub4 = "Junior" Then
ElseIf sub4 = "Junior" Then
Newlevel = "Senior"
ElseIf sub4 = "Senior" Then
Newlevel = "Congratulations, you graduated"
Else : sub4 = sub4
End If
End If
Return True
End Function
End Class