Community discussion forum

C# ComboBox selected item clear

  • 1 year ago

    Hi,

    How do i clear a combo box that has text already selected/displayed considering

    DropDownStyle was set to DropdownList.

    This is basically clearing the display and not the  items.

     

     

  • 1 year ago

    I imagine you've already found the solution to your problem, but the simplest way I know of is to set the SelectedItemIndex to -1 of set the Text property to "".

     Cheers

    Daniel
     

  • 1 year ago

    my message

    fragment:

    int c1*a1+c2*a2+c3*a3->max

    a1=0;

    a2=2*a3;

    a3=10;

    a3<=b3

    txt1.text=max.tostring();

  • 1 year ago

    thanks Daniel,

    In VS2005 I could not find SelectedItemIndex, instead i tried SelcetedIndex and set it to -1 and

    it works. Thank you.

    Elmer

  • 1 year ago

    int a,b;

    bool d1,d2;

    a=5;b=7;

    if(a>b)

    d1=true;

    else

    d2=false;

    print(d1,d2);

    end;

  • 1 year ago

    ComboBox.SelectedIndex = -1;

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!