Click here to Skip to main content
14,359,781 members
   

C#

 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Luc Pattyn18-Oct-19 5:05
professionalLuc Pattyn18-Oct-19 5:05 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
BillWoodruff18-Oct-19 5:09
mveBillWoodruff18-Oct-19 5:09 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Luc Pattyn18-Oct-19 5:19
professionalLuc Pattyn18-Oct-19 5:19 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
BillWoodruff18-Oct-19 4:54
mveBillWoodruff18-Oct-19 4:54 
AnswerRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Bernhard Hiller20-Oct-19 23:35
memberBernhard Hiller20-Oct-19 23:35 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
BillWoodruff21-Oct-19 2:01
mveBillWoodruff21-Oct-19 2:01 
QuestionCan I convert EventArgs type to PaintEventArgs type ? Pin
Member 245846717-Oct-19 18:42
memberMember 245846717-Oct-19 18:42 
AnswerRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
OriginalGriff17-Oct-19 21:09
protectorOriginalGriff17-Oct-19 21:09 
No, you can't.
Think about it this way: You have a car, and it's a Ford Fiesta. You take a badge off a Ferrari, and glue it on in place of the Ford oval badge. Does your car now do 200 mph and go round corners really well? Is it suddenly worth £100,000?

Of course not - and you are trying to do much the same thing with your code.

When you derive a class B from class A, B gets everything that is in A : field, properties, methods, events. But you have added things to B - other fields, other methods, other properties, and these do not exist in A. If you could cast an instance of A to an instance of B what would happen when you tried to use the new properties and methods? They don't exist in the original, so any information you tried to use would be "in limbo" and your app would crash because the system can't just "invent" the missing data!

Instead, you can create a new PaintEventArgs, and supply that with a new Graphics context to draw on then pass the new instance to your ShadowedTextPaint method instead - remembering to dispose of the Graphics context when you are finished with it. You can get the context with the Control.CreateGraphics Method[^]
But me? I'd pass just the Graphics context instead of a whole "dummy" PaintEventArgs - it's the only bit you need, anyway!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
Member 245846717-Oct-19 23:14
memberMember 245846717-Oct-19 23:14 
GeneralRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
OriginalGriff17-Oct-19 23:36
protectorOriginalGriff17-Oct-19 23:36 
GeneralRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
Member 245846721-Oct-19 18:03
memberMember 245846721-Oct-19 18:03 
QuestionUpdating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
jkirkerx17-Oct-19 13:50
professionaljkirkerx17-Oct-19 13:50 
AnswerRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
Luc Pattyn17-Oct-19 17:09
professionalLuc Pattyn17-Oct-19 17:09 
GeneralRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
jkirkerx18-Oct-19 7:27
professionaljkirkerx18-Oct-19 7:27 
AnswerRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
Richard Deeming18-Oct-19 2:44
mveRichard Deeming18-Oct-19 2:44 
AnswerRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
Richard Deeming18-Oct-19 3:02
mveRichard Deeming18-Oct-19 3:02 
GeneralRe: Updating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
jkirkerx18-Oct-19 7:41
professionaljkirkerx18-Oct-19 7:41 
AnswerI don't get this with IndexOf not finding the record Pin
jkirkerx18-Oct-19 9:24
professionaljkirkerx18-Oct-19 9:24 
SuggestionNeed help wind form code Pin
AlexJo198516-Oct-19 23:11
memberAlexJo198516-Oct-19 23:11 
GeneralRe: Need help wind form code Pin
lw@zi 17-Oct-19 0:17
professional lw@zi 17-Oct-19 0:17 
GeneralRe: Need help wind form code Pin
Luc Pattyn17-Oct-19 16:41
professionalLuc Pattyn17-Oct-19 16:41 
AnswerRe: Need help wind form code Pin
Richard Deeming18-Oct-19 2:32
mveRichard Deeming18-Oct-19 2:32 
GeneralRe: Need help wind form code Pin
Luc Pattyn18-Oct-19 2:44
professionalLuc Pattyn18-Oct-19 2:44 
GeneralRe: Need help wind form code Pin
Richard Deeming18-Oct-19 4:03
mveRichard Deeming18-Oct-19 4:03 
GeneralRe: Need help wind form code Pin
Luc Pattyn18-Oct-19 4:26
professionalLuc Pattyn18-Oct-19 4:26 

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.