Click here to Skip to main content
15,896,348 members
Home / Discussions / C#
   

C#

 
Questionwrite a program like windows magnify Pin
itresearches8-Apr-10 5:09
itresearches8-Apr-10 5:09 
AnswerRe: write a program like windows magnify Pin
EliottA8-Apr-10 8:50
EliottA8-Apr-10 8:50 
QuestionAccessing to a control created at runtime Pin
aleroot8-Apr-10 5:05
aleroot8-Apr-10 5:05 
AnswerRe: Accessing to a control created at runtime Pin
OriginalGriff8-Apr-10 5:28
mveOriginalGriff8-Apr-10 5:28 
GeneralRe: Accessing to a control created at runtime Pin
aleroot8-Apr-10 5:40
aleroot8-Apr-10 5:40 
GeneralRe: Accessing to a control created at runtime Pin
aleroot8-Apr-10 9:42
aleroot8-Apr-10 9:42 
QuestionPassing database login info to Crystal report - problem going to production Pin
jamesc698-Apr-10 4:54
jamesc698-Apr-10 4:54 
Questionstatic property with polymorphism Pin
lukeer8-Apr-10 4:12
lukeer8-Apr-10 4:12 
Hello experts,

imagine an abstract base class CBase and two derived classes CChildOne and CChildTwo. The children represent some kinds of devices. They inherit all the stuff they have in common from CBase.

What I'm trying is to use CBase as often as possible to prevent lots of case differentiations.

I need the class at hand to tell me which icon to draw for an instance of that class. I would like CBase to have a property DeviceIcon, which is static. That way I wouldn't have to create an instance every time I need the icon. And I also would like to override that property in CChildOne and CChildTwo to always get the correct icon.

Visual Studio tells me that a property cannot use both abstract and static keywords. Anyone an idea how to get that going?
Or will I have to bite the bullet and forget about the static part?
Ciao,


luker

AnswerRe: static property with polymorphism Pin
PIEBALDconsult8-Apr-10 4:28
mvePIEBALDconsult8-Apr-10 4:28 
GeneralRe: static property with polymorphism Pin
lukeer8-Apr-10 4:34
lukeer8-Apr-10 4:34 
AnswerRe: static property with polymorphism Pin
Jimmanuel8-Apr-10 4:38
Jimmanuel8-Apr-10 4:38 
AnswerRe: static property with polymorphism Pin
Luc Pattyn8-Apr-10 4:46
sitebuilderLuc Pattyn8-Apr-10 4:46 
AnswerRe: static property with polymorphism Pin
PIEBALDconsult8-Apr-10 5:06
mvePIEBALDconsult8-Apr-10 5:06 
GeneralRe: static property with polymorphism Pin
harold aptroot8-Apr-10 6:10
harold aptroot8-Apr-10 6:10 
GeneralRe: static property with polymorphism Pin
Luc Pattyn8-Apr-10 6:59
sitebuilderLuc Pattyn8-Apr-10 6:59 
GeneralRe: static property with polymorphism Pin
PIEBALDconsult8-Apr-10 8:13
mvePIEBALDconsult8-Apr-10 8:13 
AnswerSolved: static property with polymorphism Pin
lukeer9-Apr-10 2:59
lukeer9-Apr-10 2:59 
QuestionCOM port send/receive Pin
mprice2148-Apr-10 4:02
mprice2148-Apr-10 4:02 
AnswerRe: COM port send/receive Pin
PIEBALDconsult8-Apr-10 4:16
mvePIEBALDconsult8-Apr-10 4:16 
GeneralRe: COM port send/receive Pin
mprice2148-Apr-10 4:23
mprice2148-Apr-10 4:23 
GeneralRe: COM port send/receive Pin
PIEBALDconsult8-Apr-10 5:25
mvePIEBALDconsult8-Apr-10 5:25 
GeneralRe: COM port send/receive Pin
mprice2148-Apr-10 8:42
mprice2148-Apr-10 8:42 
GeneralRe: COM port send/receive Pin
PIEBALDconsult8-Apr-10 11:25
mvePIEBALDconsult8-Apr-10 11:25 
GeneralRe: COM port send/receive Pin
mprice2148-Apr-10 14:20
mprice2148-Apr-10 14:20 
GeneralRe: COM port send/receive Pin
PIEBALDconsult8-Apr-10 17:13
mvePIEBALDconsult8-Apr-10 17:13 

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.