473,671 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Control Properties of Type System.Drawing. Color

That looks like proper Property set code to me. What is the line of code
that the designer is generating in the Sub InitializeCompo nent for a color
that you select in the Properties Settings?

"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:er******** ********@TK2MSF TNGP02.phx.gbl. ..
Actually, it is a custom control that inherits System.Web.UI.C ontrol. My
code for the BackgroundColor property is:

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

Me._backgroundc olor is declared as:

Private _backgroundcolo r 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.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Oct 27 '08 #1
1 1825
I don't think I understood any of what you just said. What is
InitializeCompo nent? It is not listed in the events for the control. I don't
know a whole lot about developing desktop applications, but is it something
specific to them (keep in mind that I am inheriting from
System.Web.UI.C ontrol, which is used on web forms, not windows forms)? If
you could please clarify what you just said, it might help. Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"James Hahn" <jh***@yahoo.co mwrote in message
news:uI******** ******@TK2MSFTN GP02.phx.gbl...
That looks like proper Property set code to me. What is the line of code
that the designer is generating in the Sub InitializeCompo nent for a color
that you select in the Properties Settings?

"Nathan Sokalski" <nj********@hot mail.comwrote in message
news:er******** ********@TK2MSF TNGP02.phx.gbl. ..
>Actually, it is a custom control that inherits System.Web.UI.C ontrol. My
code for the BackgroundColor property is:

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

Me._background color is declared as:

Private _backgroundcolo r 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.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Oct 28 '08 #2

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

Similar topics

3
6819
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 figure out, if there is a way of using polymorphic way (if that is a word) of doing this particular property. A sample of my code is as follows: DynamicControls.ButtonControl(this,btnSearchByName, new Point(5, 75), new Size(95, 20),...
9
3958
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 will not set the value of the control and will leave the checked status of the checkbox to false when a user selects a new date. this works fine when using the control on a win2k machine but if we use it on a win XP box and call
2
3972
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 one category(Appearance, Behavior,ecc.) but I want to chose directly which properties to show.I've read that I can use the SelectedObjects to put an array of object with some properties in common with the SelectedObject,and only properties in...
0
1923
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.. Chris. code :
0
1897
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 messages in the form which has drawn the control. Evidently, the control is consuming all of these messages. How can I pass them back/on? I have a reference to the owner form but calling Refresh() via this reference isn't helping. Help! Do I need to...
0
5561
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 is used to view the state of the running jobs and schedule new jobs. The control also runs in the context of Internet Explorer (we do this so the administrators of the jobs can always receive the latest control). The property grid is used to...
3
6750
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 following default properties: Height = 32px, Width = 144px. I declare the Width property in my control as... \\\
0
3256
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 time. If I type the code in the aspx manually it does get parsed correctly though. This is an example of the aspx code that gets parsed correctly. For some reason, if I changed update the Tab property of the control through the GUI at design...
1
2480
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 property changes, the Image, Text, TextAlignment, etc. properties are changed for the control. What happens is that when I put the control on a form and I set the ButtonType property, all the fields that are changed are then highlighted as...
6
621
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? "Nathan Sokalski" <njsokalski@hotmail.comwrote in message news:er%23hyAFOJHA.1896@TK2MSFTNGP02.phx.gbl...
0
8483
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8927
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8605
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6237
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.