PC Review


Reply
Thread Tools Rate Thread

Design time property on a control

 
 
David Glover
Guest
Posts: n/a
 
      30th Sep 2003
Hi,

I have worked through the example at
http://www.intelliprog.com/articles/index.html to create a control,
however I have a question. How do I create a property which will be
accessible from the properties window of the designer?

I wish to add a Maximum Value, and Control Colour property, and the
details provided in the article are not very detailed as to how you go
about this.

Many thanks for any help,

Regards,

David Glover
 
Reply With Quote
 
 
 
 
Maarten Struys
Guest
Posts: n/a
 
      30th Sep 2003
Is it clear how design time support works for controls? When you just create
public properties on a control with design time support they will be added
automatically to the properties window of the designer. The article shows
how to set a default value for a property and how to add intellisense
information for VS.NET by using attributes. Other attributes exist to
explicitely hide control properties from the properties window etc. The
online help in VS.NET 2003 (look for "design-time functionality, about
design-time functionality") might be helpfull. Just realize that you need to
compile this conditionally for designer support for a .NET CF application.
Hopes this helps you a little further.

--
Regards,

Maarten Struys
PTS Software bv

"David Glover" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have worked through the example at
> http://www.intelliprog.com/articles/index.html to create a control,
> however I have a question. How do I create a property which will be
> accessible from the properties window of the designer?
>
> I wish to add a Maximum Value, and Control Colour property, and the
> details provided in the article are not very detailed as to how you go
> about this.
>
> Many thanks for any help,
>
> Regards,
>
> David Glover



 
Reply With Quote
 
David So [MSFT]
Guest
Posts: n/a
 
      8th Oct 2003
Simply place the property code within the class

public int MaximumValue
{
get
{
return m_maxValue;
}
set
{
m_maxValue = value;

this.Invalidate();
}
}

public System.Drawing.Color Color
{
get
{
return m_Color;
}
set
{
m_Color = value;
this.Invalidate();
}
}

And it would automatically appears in the designer when you compile your
design time version.

David
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Maarten Struys" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
| Subject: Re: Design time property on a control
| Date: Tue, 30 Sep 2003 23:27:52 +0200
| Lines: 37
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <(E-Mail Removed)>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: stejo.com 62.58.149.90
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:34808
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Is it clear how design time support works for controls? When you just
create
| public properties on a control with design time support they will be added
| automatically to the properties window of the designer. The article shows
| how to set a default value for a property and how to add intellisense
| information for VS.NET by using attributes. Other attributes exist to
| explicitely hide control properties from the properties window etc. The
| online help in VS.NET 2003 (look for "design-time functionality, about
| design-time functionality") might be helpfull. Just realize that you need
to
| compile this conditionally for designer support for a .NET CF application.
| Hopes this helps you a little further.
|
| --
| Regards,
|
| Maarten Struys
| PTS Software bv
|
| "David Glover" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > Hi,
| >
| > I have worked through the example at
| > http://www.intelliprog.com/articles/index.html to create a control,
| > however I have a question. How do I create a property which will be
| > accessible from the properties window of the designer?
| >
| > I wish to add a Maximum Value, and Control Colour property, and the
| > details provided in the article are not very detailed as to how you go
| > about this.
| >
| > Many thanks for any help,
| >
| > Regards,
| >
| > David Glover
|
|
|

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control property available at design time only Johnny Jörgensen Microsoft VB .NET 2 26th Jun 2007 10:07 AM
can a custom control have an image property that can be set in design time from the property browser? news.austin.rr.com Microsoft Dot NET Compact Framework 3 3rd Mar 2005 02:08 AM
DataSource property to control design time =?Utf-8?B?TW9ydGVuIEx5aHI=?= Microsoft Dot NET Framework Forms 1 1st Jun 2004 09:24 AM
Control Property holds a reference to another control at design time? D. Yates Microsoft C# .NET 0 26th Feb 2004 06:05 AM
Design Time Control Property Option Tomislav Markovski Microsoft Dot NET Framework Forms 1 14th Oct 2003 02:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:45 PM.