Click here to Skip to main content
16,007,760 members
Home / Discussions / C#
   

C#

 
GeneralRe: Component Text Property Pin
je_gonzalez24-Mar-04 8:55
je_gonzalez24-Mar-04 8:55 
GeneralRe: Component Text Property Pin
Heath Stewart24-Mar-04 9:02
protectorHeath Stewart24-Mar-04 9:02 
GeneralRe: Component Text Property Pin
je_gonzalez24-Mar-04 9:13
je_gonzalez24-Mar-04 9:13 
GeneralRe: Component Text Property Pin
Heath Stewart24-Mar-04 9:18
protectorHeath Stewart24-Mar-04 9:18 
GeneralRe: Component Text Property Pin
je_gonzalez24-Mar-04 9:26
je_gonzalez24-Mar-04 9:26 
GeneralRe: Component Text Property Pin
Heath Stewart24-Mar-04 8:47
protectorHeath Stewart24-Mar-04 8:47 
GeneralRe: Component Text Property Pin
dbetting24-Mar-04 15:41
dbetting24-Mar-04 15:41 
GeneralRe: Component Text Property Pin
Heath Stewart24-Mar-04 17:08
protectorHeath Stewart24-Mar-04 17:08 
These are all design-time attributes. The DefaultAttribute is there to facilitate resetting the property value. Using a method that returns a bool called ShouldSerializePropertyName also facilitates this goal.

Again, though, don't use new. Only use this when you want to hide a member. For instance, if you use new, any code that refers to your class as a Control (where Text is defined as a virtual method) or any other derivative of Control (before your class), then the virtual Text is used. Only when a variable is declared as your Type will your Text be used. Since much of the Windows Forms implementation refers to all child controls as Control types, your Text accessors wouldn't be called.

To note (since you obviously read the little flame war that shouldn't have been), I don't completely advocate RTFM. RTFM goes well with RTFF, but I'm a strong believer in teaching a man to fish, if you know what I mean. Reading the docs and understanding them (like the mostly consistent naming conventions, how C# relations to .NET and IL relates to the CLR, etc.) is very important, but there's also times when people get stuck - even the best have brain farts now and then.

The best thing to do is just skim the class library docs some time. Get to know where everything is. Also, whenever you have a question about a specific class, the help Index is your friend. Just type it in. Don't specify certain properties, though, like ScrollableControl.Text because it doesn't exist as a defined method of ScrollableControl - it's inherited. It will be in the member documentation for ScrollableControl but not in the index. It's just the way their help built system works (and even those like NDoc[^] which I occassionally contribute to and is very popular).

Once you get to know where all the classes are roughly and how everything is named, it's not too hard finding what you need if you can't remember or even if you don't know exactly what you're looking for.

 

Microsoft MVP, Visual C#
My Articles
Generalversion numbers Pin
surgeproof24-Mar-04 6:22
surgeproof24-Mar-04 6:22 
GeneralRe: version numbers Pin
Michael Flanakin24-Mar-04 6:50
Michael Flanakin24-Mar-04 6:50 
GeneralRe: version numbers Pin
surgeproof24-Mar-04 7:15
surgeproof24-Mar-04 7:15 
GeneralRe: version numbers Pin
Heath Stewart24-Mar-04 8:55
protectorHeath Stewart24-Mar-04 8:55 
GeneralRe: version numbers Pin
surgeproof24-Mar-04 9:19
surgeproof24-Mar-04 9:19 
GeneralRe: version numbers Pin
Michael Flanakin24-Mar-04 10:32
Michael Flanakin24-Mar-04 10:32 
QuestionTransparent Label on a Progressbar? Pin
DennisMetz24-Mar-04 5:54
DennisMetz24-Mar-04 5:54 
AnswerRe: Transparent Label on a Progressbar? Pin
surgeproof24-Mar-04 6:24
surgeproof24-Mar-04 6:24 
AnswerRe: Transparent Label on a Progressbar? Pin
Heath Stewart24-Mar-04 9:54
protectorHeath Stewart24-Mar-04 9:54 
GeneralRe: Transparent Label on a Progressbar? Pin
DennisMetz24-Mar-04 11:40
DennisMetz24-Mar-04 11:40 
GeneralApps without Mice Pin
Andrew Torrance24-Mar-04 5:43
Andrew Torrance24-Mar-04 5:43 
GeneralRe: Apps without Mice Pin
surgeproof24-Mar-04 6:15
surgeproof24-Mar-04 6:15 
GeneralRe: Apps without Mice Pin
Colin Angus Mackay24-Mar-04 6:25
Colin Angus Mackay24-Mar-04 6:25 
GeneralRe: Apps without Mice Pin
Heath Stewart24-Mar-04 9:12
protectorHeath Stewart24-Mar-04 9:12 
Questionhow to wrap some dll functions from VC6 Pin
yyf24-Mar-04 5:37
yyf24-Mar-04 5:37 
AnswerRe: how to wrap some dll functions from VC6 Pin
Heath Stewart24-Mar-04 9:08
protectorHeath Stewart24-Mar-04 9:08 
GeneralRe: how to wrap some dll functions from VC6 Pin
yyf24-Mar-04 10:23
yyf24-Mar-04 10:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.