Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
Questionaccesing form control values in class Pin
balakpn27-Feb-07 3:22
balakpn27-Feb-07 3:22 
QuestionC# CLR Problems... Pin
Illegal Operation27-Feb-07 3:04
Illegal Operation27-Feb-07 3:04 
AnswerRe: C# CLR Problems... Pin
kubben27-Feb-07 3:11
kubben27-Feb-07 3:11 
AnswerRe: C# CLR Problems... Pin
Guffa27-Feb-07 3:12
Guffa27-Feb-07 3:12 
Questionmoving ellipse Pin
t_nedelchev27-Feb-07 2:54
t_nedelchev27-Feb-07 2:54 
AnswerRe: moving ellipse Pin
Luc Pattyn28-Feb-07 3:36
sitebuilderLuc Pattyn28-Feb-07 3:36 
GeneralRe: moving ellipse Pin
t_nedelchev28-Feb-07 21:07
t_nedelchev28-Feb-07 21:07 
GeneralRe: moving ellipse Pin
Luc Pattyn1-Mar-07 0:52
sitebuilderLuc Pattyn1-Mar-07 0:52 
Hi,

some remarks:
1. you should call Dispose() on all objects you create from classes that offer a public
Dispose() method as soon as you dont need the objects any more. It applies to both
myBrush and grfx.
2. you could keep myBrush alive and reuse it over and over.
you should not do that with grfx
3. I would do the painting in a paint handler, not the timer tick (but of course the
x1/y1 update and the Invalidate() belong inside the tick handler). AS a result the
ellipse gets redrawn also every time it got damaged (e.g. when moving another window
over it without having to wait for the next timer tick (dont know what its period is).
BTW The PaintEventArgs offer you a free graphics, so you then dont need CreateGraphics
anymore, and dont have to Dispose() it.

Smile | :)




Luc Pattyn

[My Articles]

GeneralRe: moving ellipse Pin
t_nedelchev1-Mar-07 2:41
t_nedelchev1-Mar-07 2:41 
GeneralRe: moving ellipse Pin
Luc Pattyn1-Mar-07 7:18
sitebuilderLuc Pattyn1-Mar-07 7:18 
GeneralRe: moving ellipse Pin
t_nedelchev1-Mar-07 7:35
t_nedelchev1-Mar-07 7:35 
GeneralRe: moving ellipse Pin
Luc Pattyn1-Mar-07 7:52
sitebuilderLuc Pattyn1-Mar-07 7:52 
GeneralRe: moving ellipse Pin
t_nedelchev1-Mar-07 8:01
t_nedelchev1-Mar-07 8:01 
GeneralRe: moving ellipse Pin
Luc Pattyn1-Mar-07 8:25
sitebuilderLuc Pattyn1-Mar-07 8:25 
QuestionImages on form are not seen some times Pin
Sirisha.Konda27-Feb-07 2:40
Sirisha.Konda27-Feb-07 2:40 
AnswerRe: Images on form are not seen some times Pin
KeithF27-Feb-07 2:52
KeithF27-Feb-07 2:52 
GeneralRe: Images on form are not seen some times Pin
Martin#27-Feb-07 3:15
Martin#27-Feb-07 3:15 
GeneralRe: Images on form are not seen some times Pin
KeithF27-Feb-07 3:17
KeithF27-Feb-07 3:17 
GeneralRe: Images on form are not seen some times Pin
Martin#27-Feb-07 3:26
Martin#27-Feb-07 3:26 
GeneralRe: Images on form are not seen some times Pin
KeithF27-Feb-07 3:29
KeithF27-Feb-07 3:29 
AnswerRe: Images on form are not seen some times Pin
engsrini27-Feb-07 5:50
engsrini27-Feb-07 5:50 
QuestionInternal and internal protected Pin
Pankaj Garg27-Feb-07 2:08
Pankaj Garg27-Feb-07 2:08 
AnswerRe: Internal and internal protected Pin
kubben27-Feb-07 3:10
kubben27-Feb-07 3:10 
QuestionColor of tab control. Pin
Vikram.....27-Feb-07 1:43
Vikram.....27-Feb-07 1:43 
AnswerRe: Color of tab control. Pin
Martin#27-Feb-07 1:56
Martin#27-Feb-07 1:56 

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.