We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ComboBox

Thread ID:

Created:

Updated:

Platform:

Replies:

41001 Feb 20,2006 09:28 AM UTC Feb 20,2006 11:41 AM UTC Windows Forms 1
loading
Tags: FAQ
Mahan Chimanji
Asked On February 20, 2006 09:28 AM UTC

Dear Sir/Madam, I copied this code from gotdotnet.com tutorial. //it is adding items to a combobox1(cmbStyle) StringIntObject[] aStyle = new StringIntObject[3]; aStyle[0] = new StringIntObject("Simple",(int)ComboBoxStyle.Simple); aStyle[1] = new StringIntObject("Dropdown",(int)ComboBoxStyle.DropDown); aStyle[2] = new StringIntObject("Dropdownlist",(int)ComboBoxStyle.DropDownList); cmbStyle.Items.AddRange(aStyle); comboBegin.DropDownStyle = (ComboBoxStyle)aStyle[1].i; comboEnd.DropDownStyle = (ComboBoxStyle)aStyle[1].i; cmbStyle.SelectedIndex = 1; //This is adding items to a combobox2(cmbDrawMode) // Sync ComboBox draw modes to DrawMode.NORMAL StringIntObject[] aDMO = new StringIntObject[3]; aDMO[0] = new StringIntObject("Normal",(int)DrawMode.Normal); aDMO[1] = new StringIntObject("Ownerdrawfixed",(int)DrawMode.OwnerDrawFixed); aDMO[2] = new StringIntObject("Ownerdrawvariable",(int)DrawMode.OwnerDrawVariable); cmbDrawMode.Items.AddRange(aDMO); comboBegin.DrawMode = (DrawMode)aDMO[0].i; comboEnd.DrawMode = (DrawMode)aDMO[0].i; cmbDrawMode.SelectedIndex = 0; i get an error when i run the application saying are you missing an assembly directive please help.

Anupama Roy [Syncfusion]
Replied On February 20, 2006 11:41 AM UTC

Hi Mahan, You need to define the class StringIntObject as shown below: public class StringIntObject { public string s; public int i; public StringIntObject(string sz, int n) { s=sz; i=n; } public override string ToString() { return s; } } Regards, Anu.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;