Click here to Skip to main content
15,906,341 members
Home / Discussions / C#
   

C#

 
QuestionTwo abstract class with same function name Pin
.NET- India 25-Sep-08 19:36
.NET- India 25-Sep-08 19:36 
AnswerRe: Two abstract class with same function name Pin
Giorgi Dalakishvili25-Sep-08 20:41
mentorGiorgi Dalakishvili25-Sep-08 20:41 
QuestionNeed integration with MarketSmart? Pin
fmlove25-Sep-08 19:21
fmlove25-Sep-08 19:21 
QuestionPersonal Grading System Pin
myraesparar25-Sep-08 17:56
myraesparar25-Sep-08 17:56 
AnswerRe: Personal Grading System Pin
Colin Angus Mackay25-Sep-08 18:30
Colin Angus Mackay25-Sep-08 18:30 
QuestionBeginner Questions Pin
Rodziel25-Sep-08 17:16
Rodziel25-Sep-08 17:16 
AnswerRe: Beginner Questions Pin
c242326-Sep-08 0:23
c242326-Sep-08 0:23 
QuestionRe: Beginner Questions [modified] Pin
Rodziel26-Sep-08 12:29
Rodziel26-Sep-08 12:29 
AnswerRe: Beginner Questions Pin
c242328-Sep-08 21:35
c242328-Sep-08 21:35 
QuestionSave Solution to different folder Pin
upsfeup25-Sep-08 15:53
upsfeup25-Sep-08 15:53 
AnswerRe: Save Solution to different folder Pin
Steve Echols25-Sep-08 19:07
Steve Echols25-Sep-08 19:07 
QuestionHo do I suppress the Tab key, or control tabbing to a nested user control? Pin
Poolee25-Sep-08 15:47
Poolee25-Sep-08 15:47 
AnswerRe: Ho do I suppress the Tab key, or control tabbing to a nested user control? Pin
dan!sh 25-Sep-08 17:59
professional dan!sh 25-Sep-08 17:59 
GeneralRe: Ho do I suppress the Tab key, or control tabbing to a nested user control? Pin
Poolee26-Sep-08 17:48
Poolee26-Sep-08 17:48 
GeneralRe: Ho do I suppress the Tab key, or control tabbing to a nested user control? Pin
dan!sh 26-Sep-08 18:40
professional dan!sh 26-Sep-08 18:40 
GeneralRe: Ho do I suppress the Tab key, or control tabbing to a nested user control? Pin
Poolee2-Oct-08 6:51
Poolee2-Oct-08 6:51 
QuestionParse XML file and connect to a DSN Pin
Planker25-Sep-08 13:47
Planker25-Sep-08 13:47 
AnswerRe: Parse XML file and connect to a DSN Pin
Planker25-Sep-08 16:53
Planker25-Sep-08 16:53 
AnswerRe: Parse XML file and connect to a DSN Pin
PIEBALDconsult25-Sep-08 18:45
mvePIEBALDconsult25-Sep-08 18:45 
GeneralRe: Parse XML file and connect to a DSN Pin
Planker26-Sep-08 2:41
Planker26-Sep-08 2:41 
QuestionA good tutorial tu use graphics on form ? Pin
baranils25-Sep-08 11:40
baranils25-Sep-08 11:40 
AnswerRe: A good tutorial tu use graphics on form ? Pin
Anthony Mushrow25-Sep-08 12:27
professionalAnthony Mushrow25-Sep-08 12:27 
I doesn't matter too much where you draw, so long as you do it right. Basically, you either want to override the OnPaint method for a control (requires you to make a custom control, which is really easy), or simply use the OnPaint event. In either case you will get a Graphics object in the PaintEventArgs which is what you should use.

Now double buffering, try whatever it is you want without it (ie. Just draw your stuff using the aforementioned Graphics object). Then if you find that your form flickers, you may want to use double buffering. If you can it would be easier to use the DoubleBuffered property, if you can't then you can make up your own. Setting up your own double buffering is easy, simply create a bitmap with the same dimensions as your form/control and do all of your drawing to that, then you just draw the image to the screen in one go, like this:

Bitmap myBuffer = new Bitmap(200,200);

void OnPaint(object sender, PaintEventArgs e)
{
  Graphics buffer = Graphics.FromImage(myBuffer);
  //do all drawing using the 'buffer' object
  buffer.Dispose();
  //Draw your buffer to the screen
  e.Graphics.DrawImageUnscaled(myBuffer, 0, 0);
}


And if you want to go all out then check my articles here[^] (which one day I WILL get round to finishing dammit!)

My current favourite word is: Nipple!
-SK Genius

Game Programming articles start -here[^]-

GeneralRe: A good tutorial tu use graphics on form ? Pin
baranils25-Sep-08 20:02
baranils25-Sep-08 20:02 
GeneralRe: A good tutorial tu use graphics on form ? Pin
Anthony Mushrow25-Sep-08 22:21
professionalAnthony Mushrow25-Sep-08 22:21 
AnswerRe: A good tutorial tu use graphics on form ? Pin
V.25-Sep-08 20:33
professionalV.25-Sep-08 20:33 

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.