473,387 Members | 1,693 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,387 software developers and data experts.

Re: Control Properties of Type System.Drawing.Color

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:er****************@TK2MSFTNGP02.phx.gbl...
Actually, it is a custom control that inherits System.Web.UI.Control. My
code for the BackgroundColor property is:

Public WriteOnly Property BackgroundColor() As System.Drawing.Color
Set(ByVal value As System.Drawing.Color)
Me._backgroundcolor = value
End Set
End Property

Me._backgroundcolor is declared as:

Private _backgroundcolor As System.Drawing.Color

I know that my syntax for the property declaration is correct, I have used
it many times in other classes for other types (such as String, Integer,
etc.), just never with System.Drawing.Color. Any ideas? Thanks.
Since this is derived from a Web class, I can't really help much, being a
desktop guy, but I have to wonder: why WriteOnly?
Oct 27 '08 #1
1 2258
Sometimes when developing my controls I don't add the Get's until later so
that I can see more of the properties on the screen at once. And since it is
a control intended primarily for declarative usage, it will allow me to use
it normally when testing. Yes, I do plan on adding the Get's before putting
it on my site, and maybe I do have a strange style, but most of the controls
I write are simply for the enjoyment, so who cares?
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Jeff Johnson" <i.***@enough.spamwrote in message
news:eA**************@TK2MSFTNGP06.phx.gbl...
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:er****************@TK2MSFTNGP02.phx.gbl...
>Actually, it is a custom control that inherits System.Web.UI.Control. My
code for the BackgroundColor property is:

Public WriteOnly Property BackgroundColor() As System.Drawing.Color
Set(ByVal value As System.Drawing.Color)
Me._backgroundcolor = value
End Set
End Property

Me._backgroundcolor is declared as:

Private _backgroundcolor As System.Drawing.Color

I know that my syntax for the property declaration is correct, I have
used it many times in other classes for other types (such as String,
Integer, etc.), just never with System.Drawing.Color. Any ideas? Thanks.

Since this is derived from a Web class, I can't really help much, being a
desktop guy, but I have to wonder: why WriteOnly?

Oct 27 '08 #2

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

Similar topics

3
by: MikeY | last post by:
Hi Everyone, I am working in C#, windows forms.My question is this. All my button dynamic controls properties are present and accounted for except for the"FlatStyle" properties. I can't seem to...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
2
by: Mevar81 | last post by:
Hi to everybody.I have a problem with the PropertyGrid control.I want to display not all the properties of a generic Control(Button,TextBox,ComboBox,ecc.).In general I don't want to display only...
0
by: Chris Millar | last post by:
I have a user control that i wish to extend to change the date when the user selects the numeric up down button. The code explains itself, hope someone can help. any ideas appreaciated.. ...
0
by: Duncan Mole | last post by:
Hi, I have created a control which draws a title bar and provides a drop down menu for a Smart Device Application. It seemed to work fine until I came to add an event handler to act on Paint...
0
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control...
3
by: Marty McFly | last post by:
Hello, I have a control class that inherits from System.Web.UI.WebControls.Button. When I drag this control from the "My User Controls" tab in the toolbox onto the form, I want it to reflect the...
0
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design...
1
by: Wimpie van Lingen | last post by:
Hi I've created a control that inherits from the button control. The control has one additional property called ButtonType which can be set to Ok, Cancel, New, Edit, etc. When the ButtonType...
6
by: James Hahn | last post by:
That looks like proper Property set code to me. What is the line of code that the designer is generating in the Sub InitializeComponent for a color that you select in the Properties Settings? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.