Click here to Skip to main content
15,917,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why is this not CLS compliant? Pin
#realJSOP18-Jan-09 4:38
professional#realJSOP18-Jan-09 4:38 
GeneralRe: Why is this not CLS compliant? Pin
Nicholas Butler18-Jan-09 5:29
sitebuilderNicholas Butler18-Jan-09 5:29 
QuestionProgramming Web In C# Pin
trinm198718-Jan-09 1:56
trinm198718-Jan-09 1:56 
Questiondrawing gone Pin
staticv18-Jan-09 0:49
staticv18-Jan-09 0:49 
AnswerRe: drawing gone Pin
Mustafa Ismail Mustafa18-Jan-09 0:56
Mustafa Ismail Mustafa18-Jan-09 0:56 
GeneralRe: drawing gone Pin
staticv18-Jan-09 1:19
staticv18-Jan-09 1:19 
GeneralRe: drawing gone Pin
Mustafa Ismail Mustafa18-Jan-09 1:25
Mustafa Ismail Mustafa18-Jan-09 1:25 
GeneralRe: drawing gone Pin
Colin Angus Mackay18-Jan-09 1:34
Colin Angus Mackay18-Jan-09 1:34 
Ahmed Manzoor wrote:
I get the graphics from the button's CreateGraphics method and draw with it, this means that I'm drawing on the button right?


Yes.


Ahmed Manzoor wrote:
When I move the mouse inside the button's boundary it doesn't redraws, why? as soon as it gets outside the button, the drawing is gone


Because when you click a button, or hover over it the drawing of the button changes to give feedback to the user. For example when you click a button it looks pushed down, when you release your mouse button it pops back up again. Each of those drawing operations overwrite any previous drawing operations.

You draw onto the button directly. As soon as the user does anything that requires the button to redraw (clicking the button, hovering over the button, stopping hovering over the button, minimising the window, resizing the windows, moving the window, etc. etc.) then your drawing is gone and replaced with what ever the button control needs to draw.


Ahmed Manzoor wrote:
Here, what is being redrawn? the button or the form?


Depending on what triggered redrawing it could be a number of things. That is why there is an OnPaint method. Regardless of what caused the button, or its parent control, or its parent form to be redrawn, OnPaint will get called.

You must therefore override the Button's OnPaint method and supply your additional drawing code in there.

* Developer Day Scotland 2 - Free community conference
* The Blog of Colin Angus Mackay


Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

GeneralRe: drawing gone Pin
Guffa18-Jan-09 1:57
Guffa18-Jan-09 1:57 
GeneralRe: drawing gone Pin
Colin Angus Mackay18-Jan-09 2:03
Colin Angus Mackay18-Jan-09 2:03 
AnswerRe: drawing gone Pin
Colin Angus Mackay18-Jan-09 1:00
Colin Angus Mackay18-Jan-09 1:00 
AnswerRe: drawing gone Pin
Christian Graus18-Jan-09 1:23
protectorChristian Graus18-Jan-09 1:23 
GeneralRe: drawing gone Pin
Giorgi Dalakishvili18-Jan-09 1:32
mentorGiorgi Dalakishvili18-Jan-09 1:32 
GeneralRe: drawing gone Pin
Christian Graus18-Jan-09 1:37
protectorChristian Graus18-Jan-09 1:37 
GeneralRe: drawing gone Pin
staticv18-Jan-09 2:02
staticv18-Jan-09 2:02 
Questionmonitor network status Pin
George_George18-Jan-09 0:30
George_George18-Jan-09 0:30 
AnswerRe: monitor network status Pin
Ravi Bhavnani18-Jan-09 7:58
professionalRavi Bhavnani18-Jan-09 7:58 
GeneralRe: monitor network status Pin
George_George18-Jan-09 20:24
George_George18-Jan-09 20:24 
AnswerRe: monitor network status Pin
Hamid_RT22-Jan-09 23:26
Hamid_RT22-Jan-09 23:26 
GeneralRe: monitor network status Pin
George_George4-Feb-09 22:38
George_George4-Feb-09 22:38 
GeneralRe: monitor network status Pin
Hamid_RT5-Feb-09 21:50
Hamid_RT5-Feb-09 21:50 
GeneralRe: monitor network status Pin
George_George7-Feb-09 2:10
George_George7-Feb-09 2:10 
Questiondebugging managed code and native code together Pin
George_George17-Jan-09 23:58
George_George17-Jan-09 23:58 
AnswerRe: debugging managed code and native code together Pin
Abhijit Jana18-Jan-09 0:06
professionalAbhijit Jana18-Jan-09 0:06 
GeneralRe: debugging managed code and native code together Pin
George_George18-Jan-09 1:31
George_George18-Jan-09 1:31 

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.