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

Properties of Properties

I have a System.Web.UI.Control which has a property of type
System.Drawing.Font. When editing this control in an *.aspx file, how do I
assign a value to this property? If I recall correctly, the attributes in
the server tag are a combination of the property name and the property of
that property separated by a "-" or something. However, I would also like to
be able to use the Property Grid to do this. I tried using the Browsable
attribute for the property, but that did not seem to help. Here is my
current code for the property:

<System.ComponentModel.Browsable(True)WriteOnly Property Font() As
System.Drawing.Font
Set(ByVal value As System.Drawing.Font)
Me._font = value
End Set
End Property

Am I forgetting something? Any help would be appreciated. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Oct 27 '08 #1
4 1017
in general the property designer only support simple types by default
(string, numbers, enum). while the designer knows about color and size,
window fonts are not included. you will need to write your own prop designer
to support them. in the asp.net syntax, all properties must be able to be
specified as a string.

as fonts are specified to the browser via a style command, not sure why you
do not just support a style and class (CSSClass) properties.
-- bruce (sqlwork.com)
"Nathan Sokalski" wrote:
I have a System.Web.UI.Control which has a property of type
System.Drawing.Font. When editing this control in an *.aspx file, how do I
assign a value to this property? If I recall correctly, the attributes in
the server tag are a combination of the property name and the property of
that property separated by a "-" or something. However, I would also like to
be able to use the Property Grid to do this. I tried using the Browsable
attribute for the property, but that did not seem to help. Here is my
current code for the property:

<System.ComponentModel.Browsable(True)WriteOnly Property Font() As
System.Drawing.Font
Set(ByVal value As System.Drawing.Font)
Me._font = value
End Set
End Property

Am I forgetting something? Any help would be appreciated. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Oct 27 '08 #2
My reason for not using a style and class is because the control will be
generating an image, and therefore needs a System.Drawing.Font object.
Assuming you are correct in your statements, I will probably need to just
make separate properties and use the System.Drawing.Font constructor to
create the font. I was just hoping to not need to make separate properties,
but I guess that's all I can do for now since I don't know how to make
Property Designers yet (and there probably wouldn't be much point in this
case, since I only have one control that would need it). Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:28**********************************@microsof t.com...
in general the property designer only support simple types by default
(string, numbers, enum). while the designer knows about color and size,
window fonts are not included. you will need to write your own prop
designer
to support them. in the asp.net syntax, all properties must be able to
be
specified as a string.

as fonts are specified to the browser via a style command, not sure why
you
do not just support a style and class (CSSClass) properties.
-- bruce (sqlwork.com)
"Nathan Sokalski" wrote:
>I have a System.Web.UI.Control which has a property of type
System.Drawing.Font. When editing this control in an *.aspx file, how do
I
assign a value to this property? If I recall correctly, the attributes in
the server tag are a combination of the property name and the property of
that property separated by a "-" or something. However, I would also like
to
be able to use the Property Grid to do this. I tried using the Browsable
attribute for the property, but that did not seem to help. Here is my
current code for the property:

<System.ComponentModel.Browsable(True)WriteOnly Property Font() As
System.Drawing.Font
Set(ByVal value As System.Drawing.Font)
Me._font = value
End Set
End Property

Am I forgetting something? Any help would be appreciated. Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Oct 27 '08 #3
You should be able to work with this property in the property grid. The
System.Drawing.Font type has an associated editor, which the property grid
should expose to you.

What happens in the property grid?
--
John Saunders | MVP - Connected System Developer

Oct 27 '08 #4
All the Property Grid shows is the name of the property and a place to enter
a value. It shows up the same way a property of type String or Integer or
would. Is there an Property Attribute I need to add to make the associated
editor available? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"John Saunders" <no@dont.do.that.comwrote in message
news:e3****************@TK2MSFTNGP05.phx.gbl...
You should be able to work with this property in the property grid. The
System.Drawing.Font type has an associated editor, which the property grid
should expose to you.

What happens in the property grid?
--
John Saunders | MVP - Connected System Developer

Oct 27 '08 #5

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

Similar topics

2
by: Rick Austin | last post by:
I recently had to perform a reinstalltion of Windows XP (my registry seems to have become corrupt). After this completed I had to reinstall all applications since most use the registry for settings,...
4
by: Lyn | last post by:
Hi, This question may seem a bit academic... To learn more about Access VBA, I have been enumerating the properties of various form controls. This was mostly successful and I have learned a lot...
10
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a...
6
by: JerryP | last post by:
Hello, is there a way to launch the property dialogue for a directory from my c# app ? I would also like to launch the User Account Properties from Active Directory Users and Computers, and the...
3
by: Martin Montgomery | last post by:
I have, for example, a property called myProperty. I would like, when using a property grid to display the property name as "My Property". Is this possible. Is there an attribute etc Thank ...
7
by: Donald Grove | last post by:
Is it possible to retrieve field properties from a table in access2000 using code? I have tried: " dim dbs as dao.database dim tbl as dao.tabledef dim fld as dao.field dim prop as...
1
by: Christophe Peillet | last post by:
I have a CompositeControl with two types of properties: 1.) Mapped Properties that map directly to a child control's properties (ex.: this.TextboxText = m_txt.Text). These properties are handled...
7
by: Anderskj | last post by:
Hi! I am developing a c# application. I have a interface (which can change therefore my problem) If i do like this: List<PropertyInfoproperties = new List<PropertyInfo>();...
0
by: =?Utf-8?B?UmljayBHbG9z?= | last post by:
For some unknown reason (user error?), I cannot get a NameValueCollection to persist in the app.config file. Unlike other settings, I cannot get the String Collection Editor GUI to allow my to...
4
by: FullBandwidth | last post by:
I have been perusing various blogs and MSDN pages discussing the use of event properties and the EventHandlerList class. I don't believe there's anything special about the EventHandlerList class in...
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
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
by: Hystou | last post by:
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...
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.