Results 1 to 3 of 3

Thread: New to VB, Need Help With Basics

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2012
    Posts
    1

    New to VB, Need Help With Basics

    Name:  1.PNG
Views: 97
Size:  35.6 KBName:  2.PNG
Views: 100
Size:  68.6 KBName:  3.PNG
Views: 101
Size:  31.7 KB

    I recenty just started using vb and have been given a project to do for college.

    NOTE: I'm not looking for my project to be done, I just need some guidance as to why it isn't working.

    So if the screenshots uploaded successfully you'll see it's a project about cars. Basically i need to get the prices of the car that's checked into the daily/weekly/fortnightly rates but it's not working for me and i can't seem to get it right.

    I don't know whether it should be

    "If rdoPolo.Checked = True Then
    DecPrice = decPoloDaily
    End If"

    Or if the right one is

    " If rdoPolo.Checked = True Then
    txtCarDaily = decPoloDaily
    End If"

    Or if they're both completely wrong.

    Thanks for taking a look!

  2. #2
    Addicted Member
    Join Date
    Aug 2010
    Posts
    164

    Re: New to VB, Need Help With Basics

    Your form controls won't change unless you tell them to change. Declaring a variable (DecPrice) and assigning it a value doesn't tell your form to change.

    I'm guessing txtCarDaily is your TextBox. You're on the right track with the second, but you're not actually making your TextBox be 37.5 . You're going to assign decPoloDaily to its .Text value.

    Also, are you supposed to use TextBoxes or do you have a choice? If so I would go for Labels. TextBoxes imply the user can edit them and do something with it.

  3. #3
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: New to VB, Need Help With Basics

    vbnet Code:
    1. '
    2. If rdoPolo.Checked = True Then
    3.     txtCarDaily.Text = decPoloDaily.ToString
    4. End If"
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

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