Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / August 2007

Tip: Looking for answers? Try searching our database.

Filtering Properties Out

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
leepard - 20 Aug 2007 21:12 GMT
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?
leepard - 21 Aug 2007 18:50 GMT
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.

> 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
[quoted text clipped - 22 lines]
>
> Can anyone shed some light on why this is?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.