ugp

This is a a design time support program.

In this program, when select(view the properties) the
'phoneNumberControl1' usercontrol (which having Name,CountryCode,AreaCode,Phone#);
it appears a section called "PhoneData" in the properties section.

by using this "PhoneData" section, we can give the desired values to Name,CountryCode,AreaCode,Phone# at design time. And those will be appear on the textboxes.
It works fine!

But,i need to use a dropdown list there.Need to enter the country code from a Dropdown list or something like that.(Otherthen typing there.)
How to do this

(in the other program, it give the drop down list.Select the BULE

color rectangle.in there its property - RectHeight,RectWidth can be choose from the dropdown list.)
How can i do this for the above program.
i.e: Getting the CountryCode from a dropdown list.


Program:
-Run the "CustomEditor.sln", which is in the CustomEditor folder.
-(Inside that)Then open the "WindowsApplication1 - > Form1.cs" in the "Design Viewer"
-Then set the properties at the design time as mentioned.

(Note: this is a design time support program.)

Program Can be Found Here:
http://rapidshare.com/files/35367970/CustomEditor_demo.rar.html
OR
http://www.MegaShare.com/194407
OR
http://www.codeproject.com/csharp/PropertyEditor.asp

need help!


Re: Windows Forms General Design time Support; use dropdown list

Rong-Chun Zhang - MSFT

Hi ugp,

Using enum instead of string will make a list in design time. So try like this.

Code Snippet

namespace Phone_Number_Control

{

public enum CountrysName

{

US = 01,

EN = 02,

CH = 03

}

[TypeConverter(typeof(PhoneTypeConverter))]

public class PhoneNumber

{

private CountrysName name;

public CountrysName Name

{

get

{

return this.name;

}

set

{

if(null != value)

{

this.name = value;

PropertyChanged("name");

}

}

}

}

}

Hope this helps.

Regards