Click here to Skip to main content
14,391,608 members
   

C#

 
GeneralRe: is any threat (as in sql injection) possible in building a 'RowFilter for a 'DataView Pin
Luc Pattyn18-Oct-19 5:19
sitebuilderLuc 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
mveOriginalGriff17-Oct-19 21:09 
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
mveOriginalGriff17-Oct-19 23:36 
First off, as I mentioned, if you create a Graphics object, you are responsible for Disposing it - or you app (and possibly the whole of Windows) will crash when it runs out of a very limited resource!
The best way to handle that is to use a using block:
private void ShadowedTextPaint(int num)
  {
     ...
     using (Graphics g = this.CreateGraphics())
     {
        ...
     }
  }
And the system will Dispose the Graphics when it goes out of scope.

But ... why are you messing about with this?
Add a Panel or similar control to your form as a place to write your number, and in yoru Tick event handler just call Invalidate on the Panel. Add a Panel.Paint event handler and draw your text on the panel in that using the Graphics object it supplies. That way, it all fits neatly into the "normal processing" of the form, and you don't have to mess about so much - or worry about everything else that is going on.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!


modified 18-Oct-19 5:28am.

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
sitebuilderLuc 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
communityengineerRichard 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
communityengineerRichard 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
sitebuilderLuc Pattyn17-Oct-19 16:41 
AnswerRe: Need help wind form code Pin
Richard Deeming18-Oct-19 2:32
communityengineerRichard Deeming18-Oct-19 2:32 
GeneralRe: Need help wind form code Pin
Luc Pattyn18-Oct-19 2:44
sitebuilderLuc Pattyn18-Oct-19 2:44 
GeneralRe: Need help wind form code Pin
Richard Deeming18-Oct-19 4:03
communityengineerRichard Deeming18-Oct-19 4:03 
GeneralRe: Need help wind form code Pin
Luc Pattyn18-Oct-19 4:26
sitebuilderLuc Pattyn18-Oct-19 4:26 
GeneralRe: Need help wind form code Pin
#realJSOP17-Oct-19 3:01
mve#realJSOP17-Oct-19 3:01 
QuestionExistance pointers in c# Pin
Member 774487115-Oct-19 23:38
MemberMember 774487115-Oct-19 23:38 

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.