1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Programming Visual Basic Help Needed !!

Discussion in 'Programming & Webmastering' started by GT08, Nov 18, 2008.

  1. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0
    I am using Microsoft Visual Studio 2005 and using the basic settings.

    I need to know how I can only input the numbers 1 to 10 in a form of textbox. If I can't achieve this by a textbox then could you come up with a solution please?


    What I need:

    1 . I need the user to be able to only input the numbers 1 to 10.
    2. If the user inputs anything other than the numbers then a msgbox will appear stating to only use the numbers.

    P.S Step by step guide in how to achieve this please ^_^

    Many Thanks


    GT08
  2. Wozzer

    Joined:
    Jun 30, 2008
    Messages:
    1,133 (0.51/day)
    Thanks Received:
    68
    Location:
    England
    I could find out by tommorow.

    I'm currently learning "Visual Basics" at college and I have the lesson tommorow :).

    I know you have to include ">" and "<". (I think)
  3. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (5.12/day)
    Thanks Received:
    5,615
    Location:
    Cheeseland (Wisconsin, USA)
    You could use a NumericUpDown control. It allows you to set the min and max values, and the increment (in your case 1). It also allows the user to set the value manually, like a text box.
  4. DanTheBanjoman Señor Moderator

    Joined:
    May 20, 2004
    Messages:
    10,553 (2.85/day)
    Thanks Received:
    1,383
    You could use the changed method and use

    Integer.TryParse(yourtextbox.text, 1)

    Returns true or false, ie if it's integer or not. If it is integer you can check if it's between 0 and 10 using < and >.
  5. Sasqui

    Sasqui

    Joined:
    Dec 6, 2005
    Messages:
    7,430 (2.37/day)
    Thanks Received:
    1,270
    Location:
    Manchester, NH
    ^ What he said.

    Textbox1.OnEvent.LostFocus (sorry about the syntax)
    - Do the integer validation
    - If number <1 or >10, msgbox "Number must be an integer between 1 and 10"
    Textbox1.GetFocus
  6. Kreij

    Kreij Senior Monkey Moderator Staff Member

    Joined:
    Feb 6, 2007
    Messages:
    13,881 (5.12/day)
    Thanks Received:
    5,615
    Location:
    Cheeseland (Wisconsin, USA)
    While the Focus event works, I usually use the TextChanged event to check for valid characters as the user is typing them. That way you can do error checking on the fly and let the user know that they are inputting invalid values immediately when they type them.

    There is more program overhead, but if it not a resourse hungry app it works fine.

    Just my 2 cents.
  7. Noxman

    Noxman

    Joined:
    Oct 23, 2008
    Messages:
    27 (0.01/day)
    Thanks Received:
    3
    Location:
    Sweden
    Try Delphi, it's easier (for me).. ;D
    But, i think its like Sasqui / Dan says. Use their way, i can't VB, but it's pretty much like Delphi. ^^
  8. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,316 (6.34/day)
    Thanks Received:
    3,342
    Location:
    IA, USA
    There's lots of ways to do this...

    1. You could also use a MaskedTextBox but it relies more on digits than values (e.g. ## rather than a range 1-10). A MaskedTextBox would work great for 0-9, for instance.

    2. NumericUpDown, as mentioned.

    3. A TrackBar with read-only textbox displaying current value. Limit the range on the TrackBar to 1-10.

    4. Plain old TextBox with value verificaton on TextChanged event, as mentioned.

    5. TextBox + button where the button validates the input in the TextBox on click. I usually change the background color of the form control to pink to signify an error.


    You can get creative as to how to actually display the error using labels next to the input form or you could even use tooltips that pop up when the mouse is hovering over it.


    VB makes programmers lazy so I'll stress one thing VB doesn't: you have to cast. If you decide any of the methods above that involve TextBoxes, the value they store is of type string. In order to convert to string to byte (byte can represent a value of 0-255), use something like this:

    Dim value As Byte = Convert.ToByte(TextBox1.Text)

    Once you have a numeric expression of the value, you can test it for validity by conditionals. For example:

    If (value >= 1) && (value <= 10) Then
    ' value is good
    Else
    ' value is bad
    End If

    What you do in the if statement depends on which route you take to display the message.
    Last edited: Nov 18, 2008
    Crunching for Team TPU
  9. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0
    Thank you for all of your replies. I have decided to opt for this following code but it does not seem to work at all. This is a little project of mine which I would like to perfect.

    I have decided to use lbltotal2.Text = String.Empty. The total clears but then it encounters an error which says " Conversion from string "" to type 'Double' is not valid. "

    Can you fellow programmers see any mistakes in this Visual Basic coding? Also how can I stop the error from coming up as these String.Empty applies to all 14 labels.

    The code below is my VB code:


    -----------------------------------------------------------------------------------------

    Public Class Form1
    Dim CheeseTomato, HamPineapple, Vegetarian, MeatFeast, Seafood As Decimal
    Dim Cola, Lemonade, FizzyOrange As Decimal
    Dim ExtraCheese, Pepperoni, Onions, Peppers As Decimal
    Dim TotalCostPizza, TotalCostPizza2, TotalCostPizza3, TotalCostPizza4, TotalCostPizza5, TotalPizzas As Decimal
    Dim TotalCostDrinks, TotalCostDrinks2, TotalCostDrinks3, TotalCostDrinks4, TotalDrinks, TotalBase, TotalBase2 As Decimal
    Dim TotalCostToppings, TotalCostToppings2, TotalCostToppings3, TotalCostToppings4, TotalCostToppings5, TotalToppings As Decimal
    Dim TotalCost As Decimal
    Dim Order As Decimal

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub btnorder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnorder.Click
    CheeseTomato = 3.5
    HamPineapple = 4.2
    Vegetarian = 5.2
    MeatFeast = 5.8
    Seafood = 5.6
    Cola = 0.9
    Lemonade = 0.8
    FizzyOrange = 0.9
    ExtraCheese = 0.5
    Pepperoni = 0.5
    Onions = 0.5
    Peppers = 0.5
    TotalCost = 0

    If chkboxcat.Checked = True Then
    TotalCostPizza = Val(3.5) * txtbox1.Text
    End If



    If chkboxhap.Checked = True Then
    TotalCostPizza2 = Val(4.2) * txtbox2.Text


    If chkboxVeg.Checked = True Then
    TotalCostPizza3 = Val(5.2) * txtbox3.Text


    If chkboxmfeast.Checked = True Then
    TotalCostPizza4 = Val(5.8) * txtbox4.Text


    If chkboxseafood.Checked = True Then
    TotalCostPizza5 = Val(5.6) * txtbox5.Text
    End If
    End If
    End If
    End If

    TotalPizzas = TotalCostPizza + TotalCostPizza2 + TotalCostPizza3 + TotalCostPizza4 + TotalCostPizza5
    lbltotal.Text = Format(TotalPizzas, "£#,##0.00")

    If chkboxCola.Checked = True Then
    TotalCostDrinks = Val(0.9) * txtbox6.Text

    If chkboxlemonade.Checked = True Then
    TotalCostDrinks2 = Val(0.8) * txtbox7.Text


    If chkboxorange.Checked = True Then
    TotalCostDrinks3 = Val(0.9) * txtbox8.Text

    If chkboxnone.Checked = True Then
    TotalCostDrinks4 = 0
    End If
    End If
    End If
    End If

    TotalDrinks = TotalCostDrinks + TotalCostDrinks2 + TotalCostDrinks3 + TotalCostDrinks4
    lbltotal2.Text = Format(TotalDrinks, "£#,##0.00")
    If chkboxtac.Checked = True Then
    TotalBase = Val(0.0) * txtbox9.Text
    If chkboxtrad.Checked = True Then
    TotalBase2 = Val(0.0) * txtbox10.Text
    End If
    End If
    TotalBase = TotalBase + TotalBase2

    If chkboxcheese.Checked = True Then
    TotalCostToppings = Val(0.5) * txtbox11.Text


    If chkboxpproni.Checked = True Then
    TotalCostToppings2 = Val(0.5) * txtbox12.Text


    If chkboxonions.Checked = True Then
    TotalCostToppings3 = Val(0.5) * txtbox13.Text


    If chkboxpeppers.Checked = True Then
    TotalCostToppings4 = Val(0.5) * txtbox14.Text


    If chkboxnone.Checked = True Then
    TotalCostToppings5 = 0
    End If
    End If
    End If
    End If
    End If
    TotalToppings = TotalCostToppings + TotalCostToppings2 + TotalCostToppings3 + TotalCostToppings4 + TotalCostToppings5
    lbltotal3.Text = Format(TotalToppings, "£#,##0.00")

    TotalCost = TotalPizzas + TotalDrinks + TotalToppings
    lblbill.Text = Format(TotalCost, "£#,##0.00")
    If txtbox1.Text > 10 Then
    lbltotal.Text = String.Empty
    lbltotal.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox2.Text > 10 Then
    lbltotal.Text = String.Empty
    lbltotal.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox3.Text > 10 Then
    lbltotal.Text = String.Empty
    lbltotal.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox4.Text > 10 Then
    lbltotal.Text = String.Empty
    lbltotal.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox5.Text > 10 Then
    lbltotal.Text = String.Empty
    lbltotal.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox6.Text > 10 Then
    lbltotal2.Text = String.Empty
    lbltotal2.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox7.Text > 10 Then
    lbltotal2.Text = String.Empty
    lbltotal2.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox8.Text > 10 Then
    lbltotal2.Text = String.Empty
    lbltotal2.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox9.Text > 10 Then
    lbltotal4.Text = String.Empty
    lbltotal4.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox10.Text > 10 Then
    lbltotal.Text = String.Empty
    lbltotal.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox11.Text > 10 Then
    lbltotal3.Text = String.Empty
    lbltotal3.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox12.Text > 10 Then
    lbltotal3.Text = String.Empty
    lbltotal3.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox13.Text > 10 Then
    lbltotal3.Text = String.Empty
    lbltotal3.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")

    If txtbox14.Text > 10 Then
    lbltotal3.Text = String.Empty
    lbltotal3.Text = 0.0
    lblbill.Text = String.Empty
    lblbill.Text = 0.0
    MsgBox("Must enter numbers between 1 to 10")
    End If
    End If
    End If
    End If
    End If
    End If
    End If
    End If
    End If
    End If
    End If
    End If
    End If
    End If
    End Sub

    Private Sub btnclose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclose.Click
    Me.Close()
    End Sub
    End Class
  10. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,316 (6.34/day)
    Thanks Received:
    3,342
    Location:
    IA, USA
    Instead of...
    Code:
    lbltotal2.Text = String.Empty
    ...do this...
    Code:
    lbltotal2.Text = ""

    If that doesn't help, could you zip up the project folder (delete the "bin" and "obj" folders first) and attach it to your post?
    Last edited: Nov 21, 2008
    Crunching for Team TPU
  11. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0

    Doesn't seem to work. Here is my project I have uploaded with the "bin" and "obj" deleted.

    Attached Files:

  12. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,316 (6.34/day)
    Thanks Received:
    3,342
    Location:
    IA, USA
    What steps does it take to trigger the error?


    Edit: Ah, it errors when all fields are empty on: "If txtbox1.Text > 10 Then"

    This is because the conversion algorithms don't know what to make of a null value. The simple solution is to do...

    Code:
    If txtbox1.Text.Length > 0 Then
     ' Proceed as normal
    Else
     ' There's nothing there to process
    End If

    And let me give you a tip to cut down on the repetitiveness of your code. You can write a sub like this to perform all those checks:

    Code:
    Private Function Validate(ByRef obj As TextBox) As Double
      If (obj.Text.Length > 0) Then
        Dim value As Double = Convert.ToDouble(obj.Text)
        If (value.Text  > 10) Then
          obj.BackColor = Color.Pink
          MsgBox("Value must be between 1 and 10.")
        Else
          obj.BackColor = Color.White
          Return value
        End If
      End If
    End Function
    Then to validate a control, you'd just have to do the following:
    Code:
    Validate(txtbox1)
    You can play with that concept to make it how you like it. It cuts way down on the repetition. ;)
    Last edited: Nov 21, 2008
    GT08 says thanks.
    Crunching for Team TPU
  13. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0
    I'm afraid that this program I am making is not that simple.
    Let me try to explain what I am trying to achieve.

    It is a pizza restaurant. I want to make a software which can allow the waiters/waitresses to take orders from the table using a small handheld computer.

    In the software I must allow the waiters to record the table number (1 to 25), and order up to a maximum of 10 of any item on the menu. A textbox should be provided for any additional requests.

    As you can see I have already met my criteria of 'Table Numbers'.

    I am trying to design it so that any order over 10 can not be processed through thus resulting the totals back to 0 along with a message box displaying the message "You can only order up to a maximum of 10 of any item". The total should only be reset back to 0 only on the particular textbox (if more than 10). The other textbox with numbers between 1 to 10 should carry on its calculation thus keeping its total price.

    If the criteria is met between 1 to 10 then the total will appear.

    Within my program I have made about 3 or 4 "lbltotal" along with "lblbill" which would be my grand total. "lbltotal" is like the subtotal or you can call it a breakdown.


    Any other details you may want to hear more about, just tell me.


    I hope to hear from you soon.

    GT08
  14. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0

    Where would I put this code? Would it be in my form load or my txtbox1 or in my button (process order)?

    As it says " 'Return' Statement in a sub or a set cannot return a value"
  15. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0
    Damn, I realised I have to make my program count how many pizzas has been ordered and how many drinks ordered.


    It will be something like this:

    Number Of Pizzas Ordered: _____

    Number Of Drinks Ordered: _____


    I was intending to use "Val(txtbox1) + Val(txtbox2)" and so on but it comes up with an error.

    I want to display the quantity of how many pizzas ordered.

    How am I to achieve this?
  16. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,316 (6.34/day)
    Thanks Received:
    3,342
    Location:
    IA, USA
    The Private Function/End Function goes inside the Class/End Class tags.

    The Validate() bit goes any place that you want the validation to occur (either in a TextChanged or button Click event).


    Dim result As Integer = Convert.ToInt32(txtbox1.Text) + Convert.ToInt32(txtbox2.Text)



    What I did some time ago on code like yours (CheckBox enable/disable + associated TextBox) is I made a validate function similar to the one above and also an enable/disable sub routine.

    Something like...
    Code:
    Private Function Validate(ByRef checkbox As CheckBox, ByRef textbox As TextBox) As Boolean
      ' return true if valid and false if invalid
    End Function
    I put the range of values accepted in the TextBox.Tag object as like "1,10." Then in the Function, I split the two, used the first for min and the second for max. That way, one sub could take care of the validation of almost everything.


    Additionally, I added events to the checkbox to disable/enable the associated textbox. Something like...

    Code:
    Private Sub SetAssocEnable(ByVal sender As Object, ByVal e As EventArgs) Handles chkbox1.CheckedChanged, chkbox2.CheckedChanged, etc...
      Dim chk As CheckBox = sender ' Cast the sender to what it is
      Dim txt As String = "txt" & chk.Name.Substring(3) ' generate the textbox name from the checkbox name
      If (chk.Checked) Then
        Me.Controls(txt).Text = chk.Tag ' Copy stored value from checkbox
        Me.Controls(txt).Enabled = True ' Enable the Textbox
      Else
        chk.Tag = Me.Controls(txt).Text ' Store value to the checkbox
        Me.Controls(txt).Text = "0" ' Null its value so it doesn't conflict with the total
        Me.Controls(txt).Enabled = False ' Disable the Textbox
      End If
    End Sub
    Note that to use this code, the check boxes and text boxes must have a similar name. For example:
    CheckBox = chkSeaFood
    TextBox = txtSeaFood

    The code will chop off the chk (via Substring) from the CheckBox and add txt on to it giving it the full name for the Textbox to look up.
    Last edited: Nov 21, 2008
    Crunching for Team TPU
  17. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0
    Thank you for your help. Could you check over my project please? What do you think?

    I know within my code I have repeated the codes but this is the only way I know to make this program work. I am still new to this. I am always up for improvements to make this code a lot shorter whilst doing the same job.

    I am still figuring out how I can count how many pizzas and drinks (quantity) has been ordered corresponding to the orders.

    Attached Files:

  18. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,316 (6.34/day)
    Thanks Received:
    3,342
    Location:
    IA, USA
    Considering this is for a PDA, I would make the form as small as possible. To do that, I would put a TableLayoutPanel in all of those group boxes then add the controls to the tables. That allows you to keep it neat and also auto-size controls. I would also try to make the entire form fit to a table panel for the same reason (autosize).


    See above post. Doing that would remove a lot of the repetitiveness of your code.


    You need a variable in the background and += it. For instance...

    Dim PizzaCount As Integer = 0
    Dim DrinkCount As Integer = 0

    Private Sub ... ' your function that needs to modify their values
    PizzaCount += pizzasordered
    DrinkCount += drinksordered
    End Sub


    += is the same as:

    myvar = myvar + othervar
    Crunching for Team TPU
  19. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0

    This seems rather tricky to understand. I do want to understand it but could you explain more in depth as to why and how these codes work. For example what is the chkbox.tag? How do I make that work?

    I should be able to understand more if you could kindly incorporate that use of code to my project. That way I could compare that and my current project and see what the differences are.
  20. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,316 (6.34/day)
    Thanks Received:
    3,342
    Location:
    IA, USA
    .Tag is a property basically for random use. It is an object so the programmer can decide how to use it. It is there to inexplicably associate extra data to the control (like min/max values). Every Control has it. You define it. If you write an array to it, make sure to read it back as an array. If you make it a string, process it as a string.
    Crunching for Team TPU
  21. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,316 (6.34/day)
    Thanks Received:
    3,342
    Location:
    IA, USA
    I did just the Pizza one for you but a lot of the stuff I added can be reused for the other parts...

    This is coded in Visual Studio 2008 by the way so you'll probably have to add the VB files to your project. I doubt it whatever version you're using can open the solution/project files.


    Try to avoid using MessageBox very often. It annoys the user. In the example, I changed it to a ToolTip which displays details of the error by hovering over the errored object.

    Also, there is no need for a "Close/Exit" button unless you explicitly remove the "X" in the corner for whatever reason. Instinctively, people gravitate towards the "X" anyway because that's how you close 99% of applications in Windows.


    Is this for a class or a business?

    Attached Files:

    Last edited: Nov 21, 2008
    GT08 says thanks.
    Crunching for Team TPU
  22. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0

    Thanks for your reply. This is a class work where we are just practising programming skills by researching and using the scenarios.

    Here is the program I have tried to create by using your technique.

    I can't seem to apply it to all of it. How should the correct code be like?

    This is quite an intriguing way to program.

    Attached Files:

  23. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,316 (6.34/day)
    Thanks Received:
    3,342
    Location:
    IA, USA
    I'd get rid of the Extra Toppings -> None. The only reason why you'd need that is if the rest of them were Radio controls (where you can only select one). "None" is the equivilent to having none of those boxes checked.


    Yeah, that is much better.

    Some bugs...
    Change Trad to Trads on this line. The controls are named Trads: Dim PizzaBase As String() = {"TAC", "Trad"}

    Still trying to figure out why txtCola and txtLemonade are erroring...


    Edit: I just ended up deleting those two controls and readding them. That made those two errors go away assuming you're getting them.

    Before you are done, you should go through and set the order of tab stops.


    I don't see any other problems besides that...

    Oh, your Table Number combo box is missing?

    And the Form.Text is "0.50"
    Last edited: Nov 22, 2008
    Crunching for Team TPU
  24. GT08 New Member

    Joined:
    Nov 11, 2008
    Messages:
    18 (0.01/day)
    Thanks Received:
    0
    Thank you for the reply.

    How do I get rid of this error?

    "Name 'txtCola' is not declared." Line 36 Column 26
    "Name 'txtLemonade' is not declared." Line 37 Column 26

    ControlsValidate(txtCola) <---- Highlights the 'txtCola'
    ControlsValidate(txtLemonade) <---- Highlights the 'txtLemonade'

    Also what do you mean by "Edit: I just ended up deleting those two controls and readding them. That made those two errors go away assuming you're getting them."

    What two controls? How do I get to it?


    Lastly "Before you are done, you should go through and set the order of tab stops."

    How do I set the order of tab stops? What good is this? (is it good programming?)


    Thanks again for taking your time.
  25. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,316 (6.34/day)
    Thanks Received:
    3,342
    Location:
    IA, USA
    1. On the form, select txtCola (it is the input form for Cola).
    2. Once it is selected, hit delete.
    3. Rinse and repeat for txtLemonade.
    4. Now that they are both deletected, select one of the other txt##### controls like the one right below where txtLemonade used to be.
    5. Right click on it and select "Copy."
    6. Paste it into one of the open spaces. If it refuses to go in, simply drag and drop it in.
    7. Repeat for the other one.
    8. Now just rename them to what they are supposed to be: top one "txtCola" and bottom one "txtLemonade."

    VS messed up some how on them with designer code.


    Click on the control you want to check/change and alter TabStop property. The values start at 1 and work up.

    The TabStop is the order in which the tab button proceeds through the form. For instance, if you have 3 controls with tab stop 1, 2, 3 in order while you currently have focus on 1, should you press tab, it will go to 2. If you press tab again, it will go to 3. If you press tab again, it will go back to 1.

    This feature is mostly for people that will be using your program without a mouse. You can easily test it on your compiled application to see if the order is good.
    GT08 says thanks.
    Crunching for Team TPU

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page