473,396 Members | 2,020 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,396 software developers and data experts.

Setting a enumerated value as default value

Hi all.

I need to set a default value to my UserControl, but I'm getting a error
when trying reset the value via PropertyGrid on the host IDE: "Object type
cannot be converted to target type".

The value I'm wanting to set came from a enum value. See the code sample:
<DefaultValue(NavigationDirectionEnum.Down)> _
Public Property EnterKeyDirection() As NavigationDirectionEnum
Get
Return menmEditMode
End Get
Set(ByVal Value As NavigationDirectionEnum)
menmEnterKeyDirection = Value
End Set
End Property
[]s
Cesar
Nov 21 '05 #1
1 1036
Found it!

<DefaultValue(GetType(NavigationDirectionEnum), "Top")> _
Public Property EnterKeyDirection() As NavigationDirectionEnum
Get
Return menmEnterKeyDirection
End Get
Set(ByVal Value As NavigationDirectionEnum)
menmEnterKeyDirection = Value
End Set
End Property

[]s
Cesar

"Cesar Ronchese" <ronchese*smlinfo.com.br> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...
Hi all.

I need to set a default value to my UserControl, but I'm getting a error
when trying reset the value via PropertyGrid on the host IDE: "Object type
cannot be converted to target type".

The value I'm wanting to set came from a enum value. See the code sample:
<DefaultValue(NavigationDirectionEnum.Down)> _
Public Property EnterKeyDirection() As NavigationDirectionEnum
Get
Return menmEditMode
End Get
Set(ByVal Value As NavigationDirectionEnum)
menmEnterKeyDirection = Value
End Set
End Property
[]s
Cesar
Nov 21 '05 #2

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

Similar topics

2
by: Milosz - [playseven.com] | last post by:
Dim EP As System.Net.IPEndPoint = New System.Net.IPEndPoint(mIP, mPort) Dim S As Socket = New Socket(EP.AddressFamily, SocketType.Dgram, ProtocolType.Udp) ...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
22
by: Ben Finney | last post by:
Howdy all, I've recently packaged 'enum' in PyPI. In its description, I make the claim that it creates "immutable" enumeration objects, and that the enumeration values are "constant" values. ...
1
by: Nick Bassiliades | last post by:
Hi everybody, I would like to ask a very specific question about how I can re-define an enumerated attribute type. Specifically, I have two XML Schema files. In file A I have the following...
4
by: Shawnk | last post by:
This post is intended to verify that true value semantics DO NOT EXIST for the Enum class (relative to boolean operations). If this is true then (thus and therefore) you can not design state...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
7
by: John Goche | last post by:
Hello, The following program compiler and runs fine under gcc and produces the output 3. However, I am not sure whether such behavior is legal. In particular, as a related question, how would I...
1
by: senfo | last post by:
I'm using an enumerated type to identify a record type that relates to a unique ID in a database. Identity columns in SQL start at 1, while enumerated types in C# start at 0. I didn't think it...
6
by: DippyDog | last post by:
This is an old old post that I'm referencing regarding what happens when you set an integer variable to Nothing. It gets set to zero, not "Nothing." ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
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...
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
Oralloy
by: Oralloy | last post by:
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,...
0
by: Hystou | last post by:
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...
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
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.