Jump to content

Using "Enter" as an event trigger in VB 2008

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
dionysus.god

dionysus.god

    Newbie

  • Members
  • Pip
  • 2 posts
Ok, So this is my Final exam for computer programming class. What i have is two random numbers assigned a value between 1 and 20, and you have to add them together correctly to proceed.

Form Load Code:
Private Sub randomMath_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        Dim rand As New Random

        var_1.Text = rand.Next(0, 20)

        var_2.Text = rand.Next(0, 20)

        


    End Sub

This is what my form looks like so far.

Posted Image

So as you can see, you add the two numbers together and then put them into the text box. What i want is that you press enter and then it iterates. It's supposed to execute three times which i'll control with a "Do Until" statement.

Thanks for your help! =D

#2
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
You could take a look on this tutorial about key events. http://forum.codecal...-basic-net.html

Also, I'm not sure it's a good idea to use a Do Until for that, but I can't say for sure since I don't know the rest of your code.

#3
dionysus.god

dionysus.god

    Newbie

  • Members
  • Pip
  • 2 posts
Thanks for the help! that tutorial is perfect help! =D