0

Hi, I just completed a beginner's course to programming, in the Python language.
I am now enrolled in a VB programming course, and I am more of a hands on type person, so I'd like to get a head start on things before the start of my class. I am trying to code an old Python project that I think would give me a better understanding of the way VB works and can't seem to get it right. Any help would be greatly appreciated!

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim target As Integer
        target = InputBox("How far away is the target")

        If target <= 20 Then
            Here I want to print to the screen, "Direct Hit!"
        ElseIf target < 40 Then
            Here I want to print to the screen, "Partial Hit!"
        Else
            Here I want to print to the screen, "Target Out Of Range!"
        End If

    End Sub
End Class
2
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by kingsonprisonic
1

Two way.

1st.

Use Label controls for this.

Add Label controls to the form and then Use <LabelControl>.text="Something"
example

if i>5 then
me.Label1.Text="Hello World!"
endif

2nd way

Use MsgBox.

Like

MsgBox("Hello World!")
1

1st one.

Because 1st one used for printing on the form.

But 2nd one use for informing user by popping up a message.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.