listbox Problem

This is a discussion on listbox Problem within the C++ Programming forums, part of the General Programming Boards category; Hi, I've made my listbox is finally searched the item herraus which clicks the user. Unfortunately, this is written as ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    6

    listbox Problem

    Hi,

    I've made my listbox is finally searched the item herraus which clicks the user.

    Unfortunately, this is written as a string, but now I need to compare again an integer.

    Here's my problem:

    Code:
    // Get the currently selected item in the ListBox.
    String^ curItem = listBox1->SelectedItem->ToString();
    
    MessageBox::Show( curItem);  // SHOWS WHICH Item in the List is clicked
    
    if (curItem = 1)   if Number 1 is clicked my text will be visible
    {
    this->richTextBox1->Visible = true;;
    }
    hope you understand my problem with my poor english.

    I only want to know what is clicked to compare some if rules to show textboxed or hide them.

    hope you can help me.

    ty

  2. #2
    Registered User NeonBlack's Avatar
    Join Date
    Nov 2007
    Posts
    435
    I don't understand your English or you code. Do you want this:
    Code:
    if (curItem == "1")
    {
    ?
    I copied it from the last program in which I passed a parameter, which would have been pre-1989 I guess. - esbo

  3. #3
    Registered User
    Join Date
    Apr 2010
    Posts
    6
    oh my god...


    and i thought i need a integer to compare it.

    I dont thought that i can ask for a string with this "".

    ty

    i searched yesterday 4 h for this problem....

    so bad


    ty so mutch

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  2. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  3. Access a Listbox
    By cornholio in forum Windows Programming
    Replies: 1
    Last Post: 11-03-2005, 09:16 AM
  4. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 09:37 AM
  5. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 06:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21