Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 09-04-2006, 11:08 AM   #1 (permalink)
brad_galloway
Registered User
 
brad_galloway's Avatar
 
Join Date: Feb 2005
Location: Western KY
Posts: 24
brad_galloway is on a distinguished road
Textbox.Focus() Question

Sorry, I realize this question is kind of basic, but I have these three textboxes and a calculator keypad on my form. I am trying to get whatever textbox is the current focus to get the input, but for some reason my input is going to all three, can anyone help here?
Code:
Public Class Graph
    Private Sub ZeroButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ZeroButton.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "0")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "0")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "0")
        End If
    End Sub

    Private Sub OneButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OneButton.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "1")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "1")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "1")
        End If
    End Sub

    Private Sub ButtonTwo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonTwo.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "2")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "2")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "2")
        End If
    End Sub

    Private Sub ThreeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ThreeButton.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "3")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "3")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "3")
        End If
    End Sub

    Private Sub FourButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FourButton.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "4")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "4")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "4")
        End If
    End Sub

    Private Sub FiveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FiveButton.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "5")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "5")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "5")
        End If
    End Sub

    Private Sub SixButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SixButton.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "6")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "6")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "6")
        End If
    End Sub

    Private Sub SevenButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SevenButton.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "7")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "7")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "7")
        End If
    End Sub

    Private Sub EightButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EightButton.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "8")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "8")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "8")
        End If
    End Sub

    Private Sub NineButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NineButton.Click
        If Xmin_Box.Focus = True Then
            Xmin_Box.Text = String.Concat(Xmin_Box.Text, "9")
        End If
        If Xmax_box.Focus = True Then
            Xmax_box.Text = String.Concat(Xmax_box.Text, "9")
        End If
        If Interval_box.Focus = True Then
            Interval_box.Text = String.Concat(Interval_box.Text, "9")
        End If
    End Sub
End Class
brad_galloway is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DB Design Question Part II sde Program Design and Methods 10 09-02-2008 12:37 PM
anyone know a lot? question concerns php also. Rotkiv HTML, XML, Javascript, AJAX 7 01-12-2006 01:09 PM
hey redhead quick question about c/c++ rogue Standard C, C++ 2 05-23-2005 02:22 AM
Easy JavaScript question keystoneman HTML, XML, Javascript, AJAX 4 11-23-2004 06:29 AM


All times are GMT -8. The time now is 09:24 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting