DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 20 Aug 2007 13:12:18 -0700,    posted on: microsoft.public.dotnet.framework.windowsforms.controls        back       

Thread Index
  1    leepard
          2    leepard


Filtering Properties Out   
I have created a custom control where I have applied a new custom category to 
all properties I would like users to set.  All other properties I want to 
filter out.  For example, I have derived a CustomTextBox from TextBox, and 
have filtered out all properties that aren't tagged with my custom category.  
(As an example of filtering, I created a CustomTextBoxDesigner which pulls 
out properties from the design time execution by overriding 
PostFilterProperties).

This all works fine except for one thing.  I want to reuse the TextBox's 
"Size" property, BUT, have my Category be the new custom category and NOT the 
"Layout" category.  To do this I have the following:

[Category("NewCustomCategory")]
public new Size Size
{
  get {return base.Size;}
  set {base.Size = value;}
}

This works great, except, When I resize the CustomTextBox control on the 
surface it does not refresh correctly.  The size does not update.  
Interestingly enough, if I keep everything as is, and keep all "Layout" 
categories as well as the custom one, the resize of the text box is now fine. 
 

Can anyone shed some light on why this is?
Date:Mon, 20 Aug 2007 13:12:18 -0700   Author:  

RE: Filtering Properties Out   
I have since figured out that I really needed to ensure not ALL properties 
with the "Layout" category get removed.  I only wanted to remove those 
properties that were of the "Layout" category and that were also browsable.  
Doing this instead caused the refresh issue to go away.  I'm not quite sure 
which property was absolutely necessary.  Maybe ClientSize.  At any rate, the 
issue was some dependency with one of the Non-browsable properties being 
removed that the designer required for the control to refresh properly after 
a resize of the control.

"leepard" wrote:


> I have created a custom control where I have applied a new custom category to 
> all properties I would like users to set.  All other properties I want to 
> filter out.  For example, I have derived a CustomTextBox from TextBox, and 
> have filtered out all properties that aren't tagged with my custom category.  
> (As an example of filtering, I created a CustomTextBoxDesigner which pulls 
> out properties from the design time execution by overriding 
> PostFilterProperties).
> 
> This all works fine except for one thing.  I want to reuse the TextBox's 
> "Size" property, BUT, have my Category be the new custom category and NOT the 
> "Layout" category.  To do this I have the following:
> 
> [Category("NewCustomCategory")]
> public new Size Size
> {
>   get {return base.Size;}
>   set {base.Size = value;}
> }
> 
> This works great, except, When I resize the CustomTextBox control on the 
> surface it does not refresh correctly.  The size does not update.  
> Interestingly enough, if I keep everything as is, and keep all "Layout" 
> categories as well as the custom one, the resize of the text box is now fine. 
>  
> 
> Can anyone shed some light on why this is?  
Date:Tue, 21 Aug 2007 10:50:01 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us