Results 1 to 5 of 5

Thread: visual basic HELLLLPPP!!!

  1. #1
    K_I_Z_A's Avatar
    Join Date
    Apr 2004
    Location
    Darwin brus
    Posts
    1,463
    Liked
    5 times
    Points: 14,403, Level: 52
    Points: 14,403, Level: 52
    Achievements:
    Veteran (6+ years registered)

    visual basic HELLLLPPP!!!

    hey all im doing batchelor of IT externally at uni at the moment and i am learning basic visual basic and im stuck and need help... is there anyone out there who can use visual basic really well

    basically i am trying to make a simple calculator but i get stuck at the text boxes

    ive got 3 text boxes with labels and a button
    i need the user to be able to input a variable and then the button to add the 3 variables together
    at the moment i cant get passed the dim stage everytime i try to dim as integer i get underlines (which means no good) im not sure where i get the label from i tried this


    Code:
    Please Login or Register to see this snippet
    no1 being the name of the input text box

    Code:
    Please Login or Register to see this snippet
    label1 being the name of the label next to the text box.

    i feel so stupid!!!

  2. #2
    Old school chad's Avatar
    Join Date
    Jul 2000
    Posts
    1,446
    Liked
    16 times
    Points: 13,889, Level: 51
    Points: 13,889, Level: 51
    Achievements:
    Veteran (6+ years registered)
    Did you create Sub for the button click by any chance?
    This post contains tracers of humor and nuts.

  3. #3
    K_I_Z_A's Avatar
    Join Date
    Apr 2004
    Location
    Darwin brus
    Posts
    1,463
    Liked
    5 times
    Points: 14,403, Level: 52
    Points: 14,403, Level: 52
    Achievements:
    Veteran (6+ years registered)
    Code:
    Please Login or Register to see this snippet

  4. #4
    Born
    Join Date
    Sep 2007
    Posts
    26
    Liked
    0 times
    Points: 3,900, Level: 26
    Points: 3,900, Level: 26
    Achievements:
    3+ years registered
    is one of you labels called "label1"? if so you can't use it for the name of your integer.
    From what you have asked you have 3 labels likely called "label1", "label2" and "label3" the 3 textboxes will also have similar names. "Textbox1" etc.
    you can't use any of these name when decalring values.

  5. #5
    Fuck Yeah Seaking!!! Exalted Wrathlon's Avatar
    Join Date
    Jul 2003
    Location
    Geelong, Victoria
    Posts
    7,342
    Liked
    6 times
    Points: 35,292, Level: 82
    Points: 35,292, Level: 82
    Achievements:
    Veteran (6+ years registered)
    From memory you want to declare 3 variables and then make their values whatever is in the text box

    This isnt the exact code and I cant tell you off the top of my head because its been a LONG time since I did anything like this but you have to do it like this from memory:

    Private Sub Command1_Click ( )

    Dim no1 as integer
    Dim no2 as integer
    Dim no3 as integer

    no1 = "Whatever is in box 1"
    no2 = "Whatever is in box 2"
    no3 = "Whatever is in box 3"

    print no1 + no2 + no3 in the box you have for the answer.

    Basically the label of the boxes is NOT your variable name, they are the box name. You can show the data of a variable in these boxes or you can make a variable take it's value from whatever is in these boxes but you cant make the box itself a variable.
    I am Dyslexic of Borg - Your ass will be laminated.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)