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/ 1 1831
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/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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),...
|
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
|
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...
|
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 :
|
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...
| |
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...
|
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...
\\\
|
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...
|
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...
|
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...
|
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...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
|
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,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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();...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |