PC Review


Reply
Thread Tools Rate Thread

Clearing out a ComboBox

 
 
Aaron
Guest
Posts: n/a
 
      18th Nov 2004
Why is it that I cannot seem to figure out how to clear a combobox out. Am
I an idiot, or is it harder than I thought it could be? I need to retain
all the items, just clear the text area out when users open the form up
again.

I've tried:

this.cmbInches.Text = "";

and:

this.cmbInches.Items.IndexOf(0);

and neither seem to work. Can anyone give me the simple solution that I
must be overlooking?

Thanks


 
Reply With Quote
 
 
 
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      18th Nov 2004
Set the SelectedIndex to -1

--
<ctacke/>
www.opennetcf.org/sdf
Winner of the 2004 Pocket PC Magazine Best Software award


"Aaron" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Why is it that I cannot seem to figure out how to clear a combobox out.
> Am
> I an idiot, or is it harder than I thought it could be? I need to retain
> all the items, just clear the text area out when users open the form up
> again.
>
> I've tried:
>
> this.cmbInches.Text = "";
>
> and:
>
> this.cmbInches.Items.IndexOf(0);
>
> and neither seem to work. Can anyone give me the simple solution that I
> must be overlooking?
>
> Thanks
>
>



 
Reply With Quote
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      18th Nov 2004
And if it is bound to a datasource - set it to -1 twice (bug)

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Chris Tacke, eMVP" <ctacke[at]OpenNETCF_dot_org> wrote in message
news:(E-Mail Removed)...
> Set the SelectedIndex to -1
>
> --
> <ctacke/>
> www.opennetcf.org/sdf
> Winner of the 2004 Pocket PC Magazine Best Software award
>
>
> "Aaron" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Why is it that I cannot seem to figure out how to clear a combobox out.
>> Am
>> I an idiot, or is it harder than I thought it could be? I need to retain
>> all the items, just clear the text area out when users open the form up
>> again.
>>
>> I've tried:
>>
>> this.cmbInches.Text = "";
>>
>> and:
>>
>> this.cmbInches.Items.IndexOf(0);
>>
>> and neither seem to work. Can anyone give me the simple solution that I
>> must be overlooking?
>>
>> Thanks
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
clearing a combobox Ryan Microsoft Excel Programming 3 11th Feb 2009 01:41 PM
combobox not clearing =?Utf-8?B?RExlbmVlQGFvbC5jb20uY29tLihkb25vdHNwYW0p Microsoft Dot NET Framework Forms 1 10th Aug 2004 12:51 AM
Combobox clearing DataSource =?Utf-8?B?Q1NxdWFyZWQ=?= Microsoft Dot NET Framework 0 29th Oct 2003 02:31 PM
Clearing a combobox with VBA Spammastergrand Microsoft Access Forms 1 3rd Oct 2003 07:31 PM
clearing a combobox mike Microsoft VB .NET 2 29th Sep 2003 08:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:08 PM.