Results 1 to 3 of 3

Thread: text and label fix ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2012
    Posts
    31

    text and label fix ?

    noob...i want to use elseif in my label for example i have a 2 label and a button i set label1 to show "Q" then i change it to Q1 so far no problem after that i want to use if to change it to "Q2"
    but not working plz help me fix it
    button1
    Code:
    If Label1.Visible = True Then
                Label2.Text = "Q1.5"
            ElseIf Label1.Text = "Q1" Then
                Label2.Visible = True
                Label2.Text = "Q2"
            End If
    help me fix it plz

    in short how can i use IF in the correct way when using label and text i tried if label1.text = to some text but i couldn't get it to work

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: text and label fix ?

    Think about the logic you are using there
    Code:
    If Condition Then
    
    ' Code here executes when the if condition above is true
    
    ElseIF Condition Then ' this executes only if the condition above is false
    
    'Code here executes only if this condition is true .
    In the case of your posted code the elseif will only execute if the label is not visible and has a value of "Q1"

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

    Re: text and label fix ?

    Looks to me like you're jumping to a solution without actually considering what problem its supposed to solve. Start with exactly what it is you want to achieve then we'll work on a way to achieve it.
    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