Click here to Skip to main content
15,898,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: Shell extensions with C#? Pin
Wraith215-Apr-05 2:07
Wraith215-Apr-05 2:07 
GeneralPaint a region of a panel Pin
sreejeshtr14-Apr-05 19:19
sreejeshtr14-Apr-05 19:19 
GeneralRe: Paint a region of a panel Pin
Alex Korchemniy14-Apr-05 20:10
Alex Korchemniy14-Apr-05 20:10 
GeneralRe: Paint a region of a panel Pin
sreejeshtr14-Apr-05 20:52
sreejeshtr14-Apr-05 20:52 
GeneralRe: Paint a region of a panel Pin
Alex Korchemniy14-Apr-05 22:41
Alex Korchemniy14-Apr-05 22:41 
GeneralRe: Paint a region of a panel Pin
Ashok Dhamija15-Apr-05 0:03
Ashok Dhamija15-Apr-05 0:03 
GeneralRe: Paint a region of a panel Pin
Anonymous15-Apr-05 1:35
Anonymous15-Apr-05 1:35 
GeneralRe: Paint a region of a panel Pin
Mathew Hall14-Apr-05 23:57
Mathew Hall14-Apr-05 23:57 
You'll want to use the Control's Invalidate(Rectangle rc) method (see MSDN[^])

// this will only redraw a 100x100 rectange located <br />
// at the top left corner of the panel<br />
panel.Invalidate(new Rectangle(0, 0, 100, 100));


Then when you paint the panel you only paint an image if its bounding rectangle intersects with the clip rectangle

protected override void OnPaint(PaintEventArgs e)<br />
{<br />
// check if the image intersects with the clip rect<br />
Rectange imageRect = new Rectangle(imageX, imageY, imageWidth, imageHeight);<br />
<br />
if (imageRect.IntersectsWith(e.ClipRectangle))<br />
{<br />
e.Graphics.DrawImage(image, imageRect);<br />
}<br />
}


"I think I speak on behalf of everyone here when I say huh?" - Buffy
GeneralControl mustn't change it ForeColor to grey, when it is disabled Pin
Ptmk14-Apr-05 19:17
Ptmk14-Apr-05 19:17 
GeneralRe: Control mustn't change it ForeColor to grey, when it is disabled Pin
Alex Korchemniy14-Apr-05 20:20
Alex Korchemniy14-Apr-05 20:20 
GeneralRe: Control mustn't change it ForeColor to grey, when it is disabled Pin
spif200114-Apr-05 20:29
spif200114-Apr-05 20:29 
Generalwhere Pin
alexdg0414-Apr-05 19:15
alexdg0414-Apr-05 19:15 
GeneralRe: where Pin
Disrupted14-Apr-05 19:28
Disrupted14-Apr-05 19:28 
GeneralA question on garbage collection Pin
DisruptedSinner14-Apr-05 19:14
DisruptedSinner14-Apr-05 19:14 
GeneralRe: A question on garbage collection Pin
spif200114-Apr-05 19:51
spif200114-Apr-05 19:51 
GeneralRe: A question on garbage collection Pin
Disrupted14-Apr-05 19:55
Disrupted14-Apr-05 19:55 
GeneralRe: A question on garbage collection Pin
Alex Korchemniy14-Apr-05 20:07
Alex Korchemniy14-Apr-05 20:07 
GeneralRe: A question on garbage collection Pin
Disrupted14-Apr-05 20:18
Disrupted14-Apr-05 20:18 
Generalautoesize or fit labels height Pin
alexdg0414-Apr-05 18:50
alexdg0414-Apr-05 18:50 
GeneralRe: autoesize or fit labels height Pin
Alex Korchemniy14-Apr-05 18:54
Alex Korchemniy14-Apr-05 18:54 
GeneralRe: autoesize or fit labels height Pin
alexdg0414-Apr-05 19:13
alexdg0414-Apr-05 19:13 
GeneralRe: autoesize or fit labels height Pin
Alex Korchemniy14-Apr-05 19:42
Alex Korchemniy14-Apr-05 19:42 
Generalminimize form while closeing Pin
alexdg0414-Apr-05 18:43
alexdg0414-Apr-05 18:43 
GeneralRe: minimize form while closeing Pin
Alex Korchemniy14-Apr-05 18:51
Alex Korchemniy14-Apr-05 18:51 
GeneralRe: minimize form while closeing Pin
Polis Pilavas15-Apr-05 4:45
Polis Pilavas15-Apr-05 4:45 

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.