Re: Panel with double buffer
- From: " active" <activeNOSPAM@xxxxxxxxxx>
- Date: Mon, 11 Jun 2007 11:48:02 -0400
Bob, I think that is the definition.
What I'm wondering is, why would you, for example, create a Protected
property.
You make it slightly more difficult for a user to change that property, but
you don't prevent it.
(As in my example I make a new class that changes it. I suppose I could make
a new class with a public property that sets the Protected one.)
There must (I hope) be a rational for doing that.
Have you ever created a Protected property? If so why?
Thanks
"Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23KG0GyArHHA.3284@xxxxxxxxxxxxxxxxxxxxxxx
Well, now you're getting into aspects of architecture, which I can yack on
about all day :-)
The protected access keyword enforces the rule that class wishing to
change
or affect certain behaviours of an object must derive from the base class
in
question.
This was obviously a desire of the original design team.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
" active" <activeNOSPAM@xxxxxxxxxx> wrote in message
news:%23M$ya8lqHHA.4836@xxxxxxxxxxxxxxxxxxxxxxx
I don't think I was clear.
The question is why set ANY property to Protected.
It's a little harder to change then Public - but only a little harder (as
I illustrated below)
If the class prohibits inheritance Protected has a real effect,
but otherwise Protected and Public are basically the same.
"Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3890EBA6-7134-4E02-8D0C-897EF955B9FE@xxxxxxxxxxxxxxxx
I think this was an oversight.
Some would call it an unimplemented feature.
--
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
" active" <activeNOSPAM@xxxxxxxxxx> wrote in message
news:uIpJhaiqHHA.4420@xxxxxxxxxxxxxxxxxxxxxxx
A Panel object does not allow DoubleBuffered to be set.
Simply creating a new control as below allows one to set that property
so it isn't that it can't be done.
It's just a little harder.
So, why did they set the property (or any property) to Protected?
What's the rational?
Thanks
Class MyPanel
Inherits System.Windows.Forms.Panel
Public Sub New()
MyBase.New()
'The reason for this class:
'The following protected property needed to be set to reduce flicker
Me.DoubleBuffered = True
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
MyBase.Dispose(disposing)
End Sub
End Class
.
- Follow-Ups:
- Re: Panel with double buffer
- From: Bob Powell [MVP]
- Re: Panel with double buffer
- References:
- Panel with double buffer
- From: active
- Re: Panel with double buffer
- From: Bob Powell [MVP]
- Re: Panel with double buffer
- From: active
- Re: Panel with double buffer
- From: Bob Powell [MVP]
- Panel with double buffer
- Prev by Date: Re: problem with resizing 32bppArgb images
- Next by Date: Re: Panel with double buffer
- Previous by thread: Re: Panel with double buffer
- Next by thread: Re: Panel with double buffer
- Index(es):
Relevant Pages
|