473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Properties/Enum

I am trying to create a property that takes a value from an enumerated type and is displayed in the properties window for a custom control. Any ideas how to go about this anyone?
Nov 16 '05 #1
3 2641
What code have you got so far?

C

--

http://www.typemismatch.com/
(For Developers!)

"Martin" <an*******@discussions.microsoft.com> wrote in message
news:5F**********************************@microsof t.com...
I am trying to create a property that takes a value from an enumerated

type and is displayed in the properties window for a custom control. Any
ideas how to go about this anyone?
Nov 16 '05 #2
Martin,

What you need to do is to help the property grid out a bit
on the way. You do this by provinding a TypeConverter to the
property and tell it to use the EnumConverter.

[TypeConverter(typeof(EnumConverter))]
public MyEnum PropName
{
// add get/set code
}

There are a wide range of converters you can use and you can
also derive your own converter for complex types.

HTH,

//Andreas

--
ANDREAS HÃ…KANSSON
STUDENT OF SOFTWARE ENGINEERING
andreas (at) selfinflicted.org
"Martin" <an*******@discussions.microsoft.com> wrote in message news:5F**********************************@microsof t.com...
I am trying to create a property that takes a value from an enumerated type and is displayed in the properties window for a custom control. Any ideas how to go about this anyone?
Nov 16 '05 #3
Martin,

What you need to do is to help the property grid out a bit
on the way. You do this by provinding a TypeConverter to the
property and tell it to use the EnumConverter.

[TypeConverter(typeof(EnumConverter))]
public MyEnum PropName
{
// add get/set code
}

There are a wide range of converters you can use and you can
also derive your own converter for complex types.

HTH,

//Andreas

--
ANDREAS HÃ…KANSSON
STUDENT OF SOFTWARE ENGINEERING
andreas (at) selfinflicted.org
"Martin" <an*******@discussions.microsoft.com> wrote in message news:5F**********************************@microsof t.com...
I am trying to create a property that takes a value from an enumerated type and is displayed in the properties window for a custom control. Any ideas how to go about this anyone?
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: thechaosengine | last post by:
Hi all, I have a problem that I havent really come accross before. I need to be able to allow the user to set a dropdown control to a particular colour value. The permissable values come from...
2
by: Jim Heavey | last post by:
I created a class with an Enum and a Property. In another class I instatiate that class (with an Enum and a Property), but I can't seem to access it? My code looks like the following: ...
4
by: Daniel Mihaita | last post by:
Hello there, I need to code an object with two properties that binds dynamicaly, something like bind comboboxes on web pages. So my object needs to gave two properties Prop1 and Prop2. I need...
9
by: thechaosengine | last post by:
Hi all, I have a problem that I havent really come accross before. I need to be able to allow the user to set a dropdown control to a particular colour value. The permissable values come from...
2
by: roel.schreurs | last post by:
When I make an enumeration, the various values are accessed by <enum_name>.<option1>. I noticed that each option has properties that return any of the options in the enumeration, as can easily seen...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.