Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'your code should appear exactly as shown
'drag and drop a label from the control box (Label1)
'you are allowed to copy paste
'study keenly how the MsgBox() Title and Caption
'was named and the the attribute declared response As String!
Dim response As String
response = MsgBox("You wanna know your the time?", vbYesNo, "Check out") 'VbYesNo are the buttons that will appear
' you can also check out others by clicking help or search
'then go to Index and type MsgBox and press enter
If response = vbYes Then ' the msgbox will appear
'at form_load. It will have two conditions
'the first one, if the user will click on Yes
'this is what will happen
MsgBox("Hi today is:" & GetTime())
Label1.Text = GetTime()
'and if the user will click on No(VbNo)
'this is what will happen
ElseIf response = vbNo Then
MsgBox("Do Worry")
Label1.Visible = False
End If
End Sub
Function GetTime()
Return CStr(Now)
End Function
End Class
|