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?
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?
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?
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...
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:
...
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...
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...
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...
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...
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
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...
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
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...