Results 1 to 13 of 13
  1. #1
    Invidus's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    2,167
    Reputation
    23
    Thanks
    650
    My Mood
    Bored

    [Help]ComboBox Selection[Solved]

    Say i had a comx right?
    And then i wanted a TextBox to be visible once a certain item of the Comx is selected. How would i do that.

  2. #2
    MJLover's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Neverland
    Posts
    759
    Reputation
    33
    Thanks
    110
    My Mood
    Cheerful
    Quote Originally Posted by ilikewaterha View Post
    Say i had a comx right?
    And then i wanted a TextBox to be visible once a certain item of the Comx is selected. How would i do that.
    [php]If COMBOBOX1.SelectedIndex = 0 Then
    TextBox1.visible=false
    else
    textbox1.visible=true
    end if

    [/php]

  3. #3
    Invidus's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    2,167
    Reputation
    23
    Thanks
    650
    My Mood
    Bored
    Thanks MJ, i'll test now

  4. #4
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Mj's code will visible on any selected change

    Try , For a specific item it will be

    [php]
    If Combobox1.selecteditem = "Item Here" Then
    Textbox1.Visible = true
    End if
    [/php]

    or use selected index (knowing which index you want it to display on)

    [php]
    If combobox1.SelectedIndex = 1 Then 'or the index you want to display the textbox
    TextBox1.visible=true
    else
    textbox1.visible=False
    end if
    [/php]


     


     


     



    The Most complete application MPGH will ever offer - 68%




  5. #5
    Invidus's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    2,167
    Reputation
    23
    Thanks
    650
    My Mood
    Bored
    Thanks NextGen, i think its working nao =D

  6. #6
    MJLover's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Neverland
    Posts
    759
    Reputation
    33
    Thanks
    110
    My Mood
    Cheerful
    LOL, That was just an example on how to change visibility using indexes

    I was so tired that writing a single line was difficult for me at that time hehe

  7. #7
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,086
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    I would try if my vb worked :P

    Thanks this will become helpful
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  8. #8
    Invidus's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    2,167
    Reputation
    23
    Thanks
    650
    My Mood
    Bored
    definitely =D.

  9. #9
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Idk why but I prefer using textchanged

    Code:
     Private Sub ComboBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.TextChanged
          
      If ComboBox2.Text = "Whatever" Then
    textbox1.visible = true
    else
    textbox1.visible = false
    end if
            
        End Sub



  10. #10
    Invidus's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    2,167
    Reputation
    23
    Thanks
    650
    My Mood
    Bored
    That could work, but in my case i'd prefer to use NextGen's solution. Thanks for sharing though Blubb =D

  11. #11
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    My pleasure...

    Fine, both solutions are possible :P

    Depends on what you prefer



  12. #12
    Invidus's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    2,167
    Reputation
    23
    Thanks
    650
    My Mood
    Bored
    Yes! And also the situation!

  13. #13
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Not a problem, Marked Solved

    Left Open for other users


     


     


     



    The Most complete application MPGH will ever offer - 68%




Similar Threads

  1. [Help Request] Help me to solve this ? :#
    By josias008 in forum Combat Arms Help
    Replies: 9
    Last Post: 08-06-2011, 12:05 AM
  2. [Help] WMP selecting song from ListBox [solved]
    By alvaritos in forum Visual Basic Programming
    Replies: 10
    Last Post: 04-13-2011, 03:23 PM
  3. [Help]ListBox.Item.Selected[Solved]
    By hopefordope in forum Visual Basic Programming
    Replies: 6
    Last Post: 04-21-2010, 08:32 AM
  4. [Help]random selections ComboBox
    By ppl2pass in forum Visual Basic Programming
    Replies: 4
    Last Post: 03-17-2010, 03:02 PM
  5. [Help]ComboBox Selections[Solved]
    By ppl2pass in forum Visual Basic Programming
    Replies: 5
    Last Post: 03-15-2010, 02:29 PM