Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Luc Pattyn18-Oct-19 4:05
sitebuilderLuc Pattyn18-Oct-19 4:05 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
BillWoodruff18-Oct-19 4:09
professionalBillWoodruff18-Oct-19 4:09 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Luc Pattyn18-Oct-19 4:19
sitebuilderLuc Pattyn18-Oct-19 4:19 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
BillWoodruff18-Oct-19 3:54
professionalBillWoodruff18-Oct-19 3:54 
AnswerRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Bernhard Hiller20-Oct-19 22:35
Bernhard Hiller20-Oct-19 22:35 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
BillWoodruff21-Oct-19 1:01
professionalBillWoodruff21-Oct-19 1:01 
QuestionCan I convert EventArgs type to PaintEventArgs type ? Pin
Member 245846717-Oct-19 17:42
Member 245846717-Oct-19 17:42 
AnswerRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
OriginalGriff17-Oct-19 20:09
mveOriginalGriff17-Oct-19 20: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 22:14
Member 245846717-Oct-19 22:14 
GeneralRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
OriginalGriff17-Oct-19 22:36
mveOriginalGriff17-Oct-19 22:36 
GeneralRe: Can I convert EventArgs type to PaintEventArgs type ? Pin
Member 245846721-Oct-19 17:03
Member 245846721-Oct-19 17:03 
QuestionUpdating a List record within a record with c# and Linq, looking for something cleaner than add and remove Pin
jkirkerx17-Oct-19 12:50
professionaljkirkerx17-Oct-19 12: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 16:09
sitebuilderLuc Pattyn17-Oct-19 16: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 6:27
professionaljkirkerx18-Oct-19 6: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 1:44
mveRichard Deeming18-Oct-19 1: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 2:02
mveRichard Deeming18-Oct-19 2: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 6:41
professionaljkirkerx18-Oct-19 6:41 
AnswerI don't get this with IndexOf not finding the record Pin
jkirkerx18-Oct-19 8:24
professionaljkirkerx18-Oct-19 8:24 
SuggestionNeed help wind form code Pin
AlexJo198516-Oct-19 22:11
AlexJo198516-Oct-19 22:11 
GeneralRe: Need help wind form code Pin
dan!sh 16-Oct-19 23:17
professional dan!sh 16-Oct-19 23:17 
GeneralRe: Need help wind form code Pin
Luc Pattyn17-Oct-19 15:41
sitebuilderLuc Pattyn17-Oct-19 15:41 
AnswerRe: Need help wind form code Pin
Richard Deeming18-Oct-19 1:32
mveRichard Deeming18-Oct-19 1:32 
GeneralRe: Need help wind form code Pin
Luc Pattyn18-Oct-19 1:44
sitebuilderLuc Pattyn18-Oct-19 1:44 
GeneralRe: Need help wind form code Pin
Richard Deeming18-Oct-19 3:03
mveRichard Deeming18-Oct-19 3:03 
GeneralRe: Need help wind form code Pin
Luc Pattyn18-Oct-19 3:26
sitebuilderLuc Pattyn18-Oct-19 3: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.