Home All Groups Group Topic Archive Search About

ComboBox: How can I limit user to list items?

Author
29 Jan 2006 10:55 PM
A.M-SG
Hi,

How can I limit user to only available items in the combobox list?
By default user can choose one of the list items and also type anything
she/he wants!

Thank you,
Alan
Author
29 Jan 2006 11:13 PM
Tim Wilson
Set the DropDownStyle property to ComboBoxStyle.DropDownList.

--
Tim Wilson
..NET Compact Framework MVP

Show quoteHide quote
"A.M-SG" <alanalan@newsgroup.nospam> wrote in message
news:ubYHccSJGHA.2628@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> How can I limit user to only available items in the combobox list?
> By default user can choose one of the list items and also type anything
> she/he wants!
>
> Thank you,
> Alan
>
>
Are all your drivers up to date? click for free checkup

Author
30 Jan 2006 2:16 AM
Neil Ni
Hi Alan

Please set the ComboBox.DropDownStyle attribute of ComboBox.

Example:

private void InitializeComponent()
{
        ...
        this.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
        ...

}


Thanks & Regards,

Neil Ni
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=====================================================
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a week to all
Microsoft technology partners in the United States and Canada.

This and other support options are available here:

BCPS:
https://partner.microsoft.com/US/technicalsupport/supportoverview/40010469

Others: https://partner.microsoft.com/US/technicalsupport/supportoverview/

If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/default.aspx?scid=%2finternational.aspx.
=====================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Bookmark and Share