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

Dynamic Properties in user control

Hi,

I have designed a textbox that inherits from the
System.Windows.Forms.Textbox control.

when the control is readonly the back color changes to a
light blue to indicate that it is frozen.

This all works well, but i would like the color to be
configurable via the app.config file.

i know how to do this but would like to add the jazz of
using the properties window (like what the SqlConnection
component does), in that you can open the dynamic
properties window and tell the control via ticking the box
to store the connection string in the application
configuration file and it lets you specify a key name for
it.

how do i implement this functionality into my control???

Thanks in advance
Nov 15 '05 #1
3 13689

Hi Guy,
I think you can create your own control that inherts the textbox.(You also
can create a usercontrol that similar to the textbox)
Then, you can create a property to expose the textbox's back color property.
The VS.NET IDE will put the property you create in both property window
and Dynamic property window.
Then you can add back color property to app.config file through IDE.

Hope this helps.

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Guy Harwood" <gu*@hcs-ltd.co.uk>
| Sender: "Guy Harwood" <gu*@hcs-ltd.co.uk>
| Subject: Dynamic Properties in user control
| Date: Thu, 14 Aug 2003 08:28:01 -0700
| Lines: 22
| Message-ID: <11****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNieKXIo2HVrltRTTu5C0ni54LFSw==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:176456
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
|
| I have designed a textbox that inherits from the
| System.Windows.Forms.Textbox control.
|
| when the control is readonly the back color changes to a
| light blue to indicate that it is frozen.
|
| This all works well, but i would like the color to be
| configurable via the app.config file.
|
| i know how to do this but would like to add the jazz of
| using the properties window (like what the SqlConnection
| component does), in that you can open the dynamic
| properties window and tell the control via ticking the box
| to store the connection string in the application
| configuration file and it lets you specify a key name for
| it.
|
| how do i implement this functionality into my control???
|
| Thanks in advance
|

Nov 15 '05 #2
i have done this already by adding the
[DesignerSerializationVisibility(DesignerSerializat ionVisibility.Visible
)]

attribute to my 'ReadOnlyColor' property. but it does not automatically
appear in the dynamic properties window and this is the functionality i
would like.

is there an attribute i need to add????

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3

Hi Guy,

After my research, I found that the dynamic property window can only
display the property that is primitive type.
The back color property of textbox is System.Drawing.Color type, so it can
not appear in that window.

But I think you can inherit the textbox and create a property that expose
the textbox's back color as RGB color
so that it can be store as primitive type.
Hope this helps.

If you still have any unclear, please feel free to tell me.

Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: Guy Harwood <gu*@hcs-ltd.co.uk>
| References: <np**************@cpmsftngxa06.phx.gbl>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: RE: Dynamic Properties in user control
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <#F**************@tk2msftngp13.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Date: Fri, 15 Aug 2003 01:23:38 -0700
| NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftn gp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:176618
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| i have done this already by adding the
| [DesignerSerializationVisibility(DesignerSerializat ionVisibility.Visible
| )]
|
| attribute to my 'ReadOnlyColor' property. but it does not automatically
| appear in the dynamic properties window and this is the functionality i
| would like.
|
| is there an attribute i need to add????
|
|
|
| *** Sent via Developersdex http://www.developersdex.com ***
| Don't just participate in USENET...get rewarded for it!
|

Nov 15 '05 #4

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

Similar topics

1
by: Steve Gadlin | last post by:
Hi there! First off, let me apologize for the basic question... I'm very new to .NET programming. I'm building a web site using VB.NET, and am trying to include several custom user controls. ...
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...
1
by: sleigh | last post by:
Hello, I'm building a web application that will build a dynamic form based upon questions in a database. This form will have several different sections that consist of a panel containing one to...
2
by: Rubble | last post by:
Hello, Ive searched all over the net trying to find an answer to this...so anybody with some expertise in this area would be greatly appreciated. Background: I have a webform that loads a...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
1
by: Kum | last post by:
Hi, I need help in asp.net dynamic textbox controls validation. I am creating textbox controls dynamically on a asp.net webpage. Now after creating the textboxes on the page I want to validate...
0
by: jaawaad | last post by:
I'm creating webcharts control dynamically based on user input as to how many charts they would like to see. I'm running into problem as to how to set properties for those charts at run time so...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
4
Frinavale
by: Frinavale | last post by:
Introduction Sometimes, when developing web applications, we need to be able to dynamically load controls based on user selections. The following article describes a simple scenario where TextBox...
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: 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
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.