Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Public Class Form2

    Private Sub btnGO_Click(sender As Object, e As EventArgs) Handles btnGo1.Click

        Dim stFirstName As String
        Dim stLastName As String
        Dim stGender As String

        stFirstName = txtFirstName.Text
        stLastName = txtLastName.Text
        stGender = txtGender.Text

        MsgBox("Hello " & stFirstName )

    End Sub
End Class

What I have tried:

btnGO is underlined and all txt. objects are underlined as an error too.
Updated 4-Feb-23 0:41am
Richard MacCutchan 4-Feb-23 6:36am    
Are they spelled differently in the Form?
Dave Kreskowiak 4-Feb-23 13:34pm    
Character casing also matters. "btnGO" is not the same as "BtnGo".

1 solution

It most likely means that your button and text fields are not defined on the form. This could be different spelling, or just missing items.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900