Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to call from another class? Pin
Christian Graus29-Sep-07 14:18
protectorChristian Graus29-Sep-07 14:18 
AnswerRe: How to call from another class? Pin
Dave Kreskowiak29-Sep-07 19:57
mveDave Kreskowiak29-Sep-07 19:57 
GeneralRe: How to call from another class? Pin
MasterSharp30-Sep-07 3:33
MasterSharp30-Sep-07 3:33 
GeneralRe: How to call from another class? Pin
Dave Kreskowiak30-Sep-07 3:53
mveDave Kreskowiak30-Sep-07 3:53 
GeneralRe: How to call from another class? Pin
MasterSharp30-Sep-07 13:25
MasterSharp30-Sep-07 13:25 
QuestionHow to draw? Pin
MasterSharp29-Sep-07 11:06
MasterSharp29-Sep-07 11:06 
AnswerRe: How to draw? Pin
Lutosław29-Sep-07 11:28
Lutosław29-Sep-07 11:28 
AnswerRe: How to draw? Pin
Luc Pattyn29-Sep-07 11:45
sitebuilderLuc Pattyn29-Sep-07 11:45 
Hi,

there are four steps to draw something so it becomes visible on the screen:

1.
decide on what object you want to draw; it normally is a Control (e.g. a Panel) or a
Form itself. I prefer to add a Panel to a Form, then draw on the Panel.

2.
create some variables (Rectangle, struct, class, whatever) that hold the parameters of
your drawing. In your case that could be top and left coordinate, and width+height,
or just a Rectangle.

3.
create a Paint handler for that Panel, and do all your drawing in there, using the
Graphics class and your variables.

4.
when you want to animate things, modify the variables and call Panel.Invalidate() or
one of its overloads (for selective invalidation).


BTW: if you need to create some objects (Fonts, Pens, Brushes, ...) either keep them
alive in class members (hence create them only once); or create them inside the Paint
handler and don't forget to call Dispose() on them.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]


this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google


Questionerror : The left-hand side of an assignment must be a variable, property or indexer Pin
Landie11029-Sep-07 9:39
Landie11029-Sep-07 9:39 
AnswerRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Colin Angus Mackay29-Sep-07 9:50
Colin Angus Mackay29-Sep-07 9:50 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Landie11029-Sep-07 9:57
Landie11029-Sep-07 9:57 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Colin Angus Mackay29-Sep-07 10:01
Colin Angus Mackay29-Sep-07 10:01 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Landie11029-Sep-07 10:13
Landie11029-Sep-07 10:13 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Landie11029-Sep-07 10:20
Landie11029-Sep-07 10:20 
AnswerRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Guffa29-Sep-07 10:42
Guffa29-Sep-07 10:42 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Colin Angus Mackay29-Sep-07 10:49
Colin Angus Mackay29-Sep-07 10:49 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Christian Graus29-Sep-07 13:21
protectorChristian Graus29-Sep-07 13:21 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Colin Angus Mackay29-Sep-07 13:26
Colin Angus Mackay29-Sep-07 13:26 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Christian Graus29-Sep-07 13:54
protectorChristian Graus29-Sep-07 13:54 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Colin Angus Mackay29-Sep-07 10:47
Colin Angus Mackay29-Sep-07 10:47 
GeneralRe: error : The left-hand side of an assignment must be a variable, property or indexer Pin
Landie1101-Oct-07 2:18
Landie1101-Oct-07 2:18 
QuestionHelp with Prining Pin
MumbleB29-Sep-07 9:39
MumbleB29-Sep-07 9:39 
AnswerRe: Help with Prining Pin
Lutosław29-Sep-07 10:51
Lutosław29-Sep-07 10:51 
GeneralRe: Help with Prining Pin
MumbleB29-Sep-07 11:44
MumbleB29-Sep-07 11:44 
GeneralRe: Help with Prining Pin
Lutosław29-Sep-07 12:21
Lutosław29-Sep-07 12:21 

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.