MSG Box/and simple text box question

Hi,

I have an msgbox to show the user information they have typed in, and a yes/no button if it is correct:

MsgBox("Are the following correct " & vbCrLf & "length: - ", MsgBoxStyle.YesNo)

How do I get the answer from the msgbox so I can use it in an if then loop

IF msg aswer is yes then

' do something
Else
' do something else
End If

Text Box question:-

I am sure this question has been answered 100s of times, but i could not find it on the forum:-

I have a text box that the users enters a value you in, lets say amplifier gain. As amplifier gain can only be

a) A number
b) A number between 0 and 48

How do i, when the user types in something wrong display a msgbox (or something like) Saying you are an idiot please enter only numbers between 0 and 48

Many Thanks,

Andy




Answer this question

MSG Box/and simple text box question

  • neo_assyrian

    Dim zMsgAnswer As MsgBoxResult = MsgBox("Are the following correct " & vbCrLf & "length: - ", MsgBoxStyle.YesNo)

    If zMsgAnswer = MsgBoxResult.Yes Then
        ' do something
        Else
        ' do something else
    End If

  • luca morelli

    Thanks for your help


  • MSG Box/and simple text box question