Results 1 to 5 of 5

Thread: Taking in values from buttons

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    10

    Taking in values from buttons

    [deleted]_________________________________________
    Last edited by TwoyTaylor; Mar 30th, 2007 at 08:31 PM.

  2. #2
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: Taking in values from buttons

    I am assuming that you are using buttons 1 - 0 (like on a microwave) as the input for the time value. So, code such as:
    Text1.Text = Button1.Text & Button2.Text & Button3.Text
    Would put 123 into a TextBox named Text1.
    One thing you need to consider is that the 123 in Text1 will be a string and you will need to convert it to an integer value to have it work with your timer.

    Good Luck

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    10

    Re: Taking in values from buttons

    [deleted]______________________________________________
    Last edited by TwoyTaylor; Mar 30th, 2007 at 08:31 PM.

  4. #4
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: Taking in values from buttons

    It will simply print 1234567890 into the text box when I hit button 1.
    Yes, you are correct. I was just showing you how you could get the text value that appeared on your button, into a textbox. You would actually need to add the button value of each button as it is clicked. Something like:
    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    Text1.Text = Text1.Text & Button1.Text
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    Text1.Text = Text1.Text & Button2.Text
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Text1.Text = Text1.Text & Button3.Text
    End Sub
    There are a lot of ways that you could do your project and, since I don't know much about it, I can't relly state what the best way would be. And, using a textbox to hold the time value might not be the best control to use.


    Good Luck

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    10

    Re: Taking in values from buttons

    [deleted]______________________________________________
    Last edited by TwoyTaylor; Mar 30th, 2007 at 08:32 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width