Click here to Skip to main content
15,897,968 members
Home / Discussions / C#
   

C#

 
AnswerRe: cross thread operation not valid, when closing a windows form Pin
Luc Pattyn17-Apr-09 4:01
sitebuilderLuc Pattyn17-Apr-09 4:01 
QuestionNeed Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
A.Q.Ghouri17-Apr-09 1:15
A.Q.Ghouri17-Apr-09 1:15 
AnswerRe: Need Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
Rajesh Anuhya17-Apr-09 1:22
professionalRajesh Anuhya17-Apr-09 1:22 
GeneralRe: Need Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
A.Q.Ghouri20-Apr-09 18:06
A.Q.Ghouri20-Apr-09 18:06 
AnswerRe: Need Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
Giorgi Dalakishvili17-Apr-09 2:07
mentorGiorgi Dalakishvili17-Apr-09 2:07 
GeneralRe: Need Help For Reading and Sending SMS Through SonyEricsson Mobile Using C# Language Pin
A.Q.Ghouri20-Apr-09 18:29
A.Q.Ghouri20-Apr-09 18:29 
QuestionWhy the line disappear? Pin
lune1217-Apr-09 1:15
lune1217-Apr-09 1:15 
AnswerRe: Why the line disappear? Pin
Luc Pattyn17-Apr-09 1:18
sitebuilderLuc Pattyn17-Apr-09 1:18 
Hi,

that indicates you didn't paint it in the right way.
there are several steps to correctly draw something so it becomes visible on the screen:

1.
decide upon 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. For a rectangle that could be top and left coordinate, and width+height,
or just a Rectangle. etc.

3.
create a Paint handler (either add your own paint handler to the Paint event, or
override the OnPaint method) for that Panel, and do all your drawing in there,
using the Graphics class and your variables.

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

5.
If you want to animate things, perform the move (step 4) inside the Tick handler
of a Windows.Forms.Timer

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]

Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


GeneralRe: Why the line disappear? Pin
Henry Minute17-Apr-09 1:24
Henry Minute17-Apr-09 1:24 
GeneralU R D) Pin
Luc Pattyn17-Apr-09 1:38
sitebuilderLuc Pattyn17-Apr-09 1:38 
QuestionRe: Why the line disappear? Pin
lune1217-Apr-09 1:36
lune1217-Apr-09 1:36 
AnswerRe: Why the line disappear? Pin
Luc Pattyn17-Apr-09 1:40
sitebuilderLuc Pattyn17-Apr-09 1:40 
QuestionRe: Why the line disappear? Pin
lune1217-Apr-09 1:56
lune1217-Apr-09 1:56 
AnswerRe: Why the line disappear? Pin
Luc Pattyn17-Apr-09 2:02
sitebuilderLuc Pattyn17-Apr-09 2:02 
AnswerRe: Why the line disappear? Pin
0x3c017-Apr-09 1:35
0x3c017-Apr-09 1:35 
GeneralRe: Why the line disappear? Pin
Letsan17-Apr-09 4:32
Letsan17-Apr-09 4:32 
Questionhow to compare textbox text and database table field Pin
demetter17-Apr-09 0:43
demetter17-Apr-09 0:43 
AnswerRe: how to compare textbox text and database table field Pin
J a a n s17-Apr-09 1:08
professionalJ a a n s17-Apr-09 1:08 
General[Message Deleted] Pin
demetter17-Apr-09 1:46
demetter17-Apr-09 1:46 
GeneralRe: how to compare textbox text and database table field Pin
Ashfield17-Apr-09 1:56
Ashfield17-Apr-09 1:56 
GeneralRe: how to compare textbox text and database table field [modified] Pin
demetter17-Apr-09 2:17
demetter17-Apr-09 2:17 
GeneralRe: how to compare textbox text and database table field Pin
Ashfield17-Apr-09 9:08
Ashfield17-Apr-09 9:08 
QuestionAccess Data Table : Update / Insert Pin
Ravindra Bisen17-Apr-09 0:15
Ravindra Bisen17-Apr-09 0:15 
AnswerRe: Access Data Table : Update / Insert Pin
SeMartens17-Apr-09 0:43
SeMartens17-Apr-09 0:43 
AnswerRe: Access Data Table : Update / Insert Pin
Ravindra Bisen17-Apr-09 0:44
Ravindra Bisen17-Apr-09 0:44 

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.