Click here to Skip to main content
15,899,937 members
Home / Discussions / C#
   

C#

 
QuestionHow to add values of generic type T Pin
Marc Clifton2-Mar-07 7:57
mvaMarc Clifton2-Mar-07 7:57 
AnswerRe: How to add values of generic type T Pin
Guffa2-Mar-07 8:23
Guffa2-Mar-07 8:23 
GeneralRe: How to add values of generic type T Pin
Marc Clifton2-Mar-07 8:55
mvaMarc Clifton2-Mar-07 8:55 
GeneralRe: How to add values of generic type T Pin
Andrew Rissing2-Mar-07 9:11
Andrew Rissing2-Mar-07 9:11 
GeneralRe: How to add values of generic type T Pin
Marc Clifton2-Mar-07 9:36
mvaMarc Clifton2-Mar-07 9:36 
AnswerRe: How to add values of generic type T Pin
Insincere Dave2-Mar-07 9:12
Insincere Dave2-Mar-07 9:12 
GeneralRe: How to add values of generic type T Pin
Marc Clifton2-Mar-07 9:34
mvaMarc Clifton2-Mar-07 9:34 
QuestionHow to work with Double Buffering C# Pin
laura13162-Mar-07 7:57
laura13162-Mar-07 7:57 
Hi All:

I am trying to work with the built in double buffering in C# Visual Studio 2005. I want to have no flicker. I have a timer event that throws an event every 100 ms when the timer event occurs it draws a square at the given location. This occurs very quickly. Behind the square is a four quadrant background. I am trying to do the double buffering so that the background is not redrawn everytime or so that it is smoother. When I set the doublebuffer function to true it flickers faster so I am obviously not doing something right. Please help!

Please view my Paint function:
<br />
public void XYZ_PaintData(object sender, PaintEventArgs e)<br />
        {<br />
            Graphics g = e.Graphics;<br />
            Pen penRed = new Pen(Color.Red, 2);<br />
            Pen penGreen = new Pen(Color.Green, 2);<br />
            Pen penBlue = new Pen(Color.Blue, 2);<br />
            Pen penWhite = new Pen(Color.White, 1);<br />
            Pen penBack = new Pen(Color.Gray, 1);<br />
<br />
            //Graphics g = this.CreateGraphics();<br />
            //g.Clear(this.BackColor);<br />
            this.DoubleBuffered = true;<br />
<br />
            /*Pen penRed = new Pen(Color.Red, 2);<br />
            Pen penGreen = new Pen(Color.Green, 2);<br />
            Pen penBlue = new Pen(Color.Blue, 2);<br />
            Pen penWhite = new Pen(Color.White, 1);<br />
            Pen penBack = new Pen(Color.Gray, 1);*/<br />
               <br />
            penBack.DashStyle = DashStyle.Solid;<br />
<br />
            // Background<br />
            g.DrawLine(penBack, 375, 105, 375, 600);<br />
            g.DrawLine(penBack, 50, 325, 650, 325);<br />
            g.DrawRectangle(penBack, x0XYZ, y0XYZ, x1XYZ, y1XYZ);<br />
            AccelReadings = true;<br />
<br />
            //Line that is drawn when timer event occurs<br />
            g.DrawRectangle(Pens.Black, xMXYZ, yMXYZ, 2, 2);<br />
           <br />
<br />
        }<br />


Laura
AnswerRe: How to work with Double Buffering C# Pin
Dave Kreskowiak2-Mar-07 8:06
mveDave Kreskowiak2-Mar-07 8:06 
AnswerRe: How to work with Double Buffering C# Pin
Luc Pattyn2-Mar-07 9:41
sitebuilderLuc Pattyn2-Mar-07 9:41 
AnswerRe: How to work with Double Buffering C# Pin
Patrick Etc.2-Mar-07 10:13
Patrick Etc.2-Mar-07 10:13 
QuestionTimers in Online Exams Pin
archu12-Mar-07 7:05
archu12-Mar-07 7:05 
AnswerRe: Timers in Online Exams Pin
Parwej Ahamad2-Mar-07 7:21
professionalParwej Ahamad2-Mar-07 7:21 
QuestionCAN ANY BODY ANSWER TO QUESTION/!!!!!???? Pin
conemajstor2-Mar-07 4:48
conemajstor2-Mar-07 4:48 
AnswerRe: CAN ANY BODY ANSWER TO QUESTION/!!!!!???? Pin
Colin Angus Mackay2-Mar-07 5:21
Colin Angus Mackay2-Mar-07 5:21 
AnswerRe: CAN ANY BODY ANSWER TO QUESTION/!!!!!???? Pin
Dave Kreskowiak2-Mar-07 6:16
mveDave Kreskowiak2-Mar-07 6:16 
QuestionHow can i save data in access database Pin
conemajstor2-Mar-07 4:18
conemajstor2-Mar-07 4:18 
AnswerRe: How can i save data in access database Pin
Chris Buckett2-Mar-07 5:19
Chris Buckett2-Mar-07 5:19 
QuestionAssembly initialization... Pin
Phil Boyd2-Mar-07 3:55
Phil Boyd2-Mar-07 3:55 
AnswerRe: Assembly initialization... Pin
Scott Dorman2-Mar-07 4:25
professionalScott Dorman2-Mar-07 4:25 
GeneralRe: Assembly initialization... Pin
Phil Boyd2-Mar-07 6:54
Phil Boyd2-Mar-07 6:54 
GeneralRe: Assembly initialization... Pin
Scott Dorman2-Mar-07 7:01
professionalScott Dorman2-Mar-07 7:01 
GeneralRe: Assembly initialization... Pin
Phil Boyd2-Mar-07 11:12
Phil Boyd2-Mar-07 11:12 
QuestionHow to stop a timer from within it's eventhandler? Pin
Hussam Fattahi2-Mar-07 3:52
Hussam Fattahi2-Mar-07 3:52 
AnswerRe: How to stop a timer from within it's eventhandler? Pin
Stefan Troschuetz2-Mar-07 4:28
Stefan Troschuetz2-Mar-07 4:28 

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.