Click here to Skip to main content
15,912,665 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGridView customization Pin
Xmen Real 25-Mar-08 15:28
professional Xmen Real 25-Mar-08 15:28 
Questionhow i can make remote backup server using C# Pin
saiftanoli25-Mar-08 5:51
saiftanoli25-Mar-08 5:51 
AnswerRe: how i can make remote backup server using C# Pin
led mike25-Mar-08 5:55
led mike25-Mar-08 5:55 
QuestionHow to add text in richtextbox from rtf file? Pin
Aravinthan25-Mar-08 5:51
Aravinthan25-Mar-08 5:51 
AnswerRe: How to add text in richtextbox from rtf file? Pin
led mike25-Mar-08 5:56
led mike25-Mar-08 5:56 
GeneralRe: How to add text in richtextbox from rtf file? Pin
Aravinthan25-Mar-08 6:30
Aravinthan25-Mar-08 6:30 
QuestionGDI+ Invalidate() artifacts Pin
Herbertmunch25-Mar-08 5:29
Herbertmunch25-Mar-08 5:29 
GeneralRe: GDI+ Invalidate() artifacts Pin
vineas25-Mar-08 7:04
vineas25-Mar-08 7:04 
Without running your code, I'm thinking the problem is here:

protected override void OnMouseMove(MouseEventArgs e)
{
      //Invalidate old location
      Invalidate(r);
      r.Location = e.Location;
      //Invalidate new location
      Invalidate(r);
}


The first call to Invalidate(r) fills the rectangle then draws it. You then move the rectangle and call Invalidate(r) again which fills the relocated rectangle and then draws it - however, there is no code that is repainting over the old rectangle. You need to keep track of the area that was under the original rectangle and invalidate the union of the old rectangle and the new one (you will only need to call invaldiate once in OnMouseMove when you do this). Also, the call to e.Graphics.FillRectangle(Brushes.White, r) in the OnPaint method will need to be adjusted to fill the clip region (can't remember the property name off hand, but should be easy enough to find).

-----
In the land of the blind, the one eyed man is king.

GeneralRe: GDI+ Invalidate() artifacts Pin
Herbertmunch25-Mar-08 9:32
Herbertmunch25-Mar-08 9:32 
GeneralRe: GDI+ Invalidate() artifacts Pin
vineas25-Mar-08 11:49
vineas25-Mar-08 11:49 
GeneralRe: GDI+ Invalidate() artifacts Pin
Herbertmunch27-Mar-08 9:49
Herbertmunch27-Mar-08 9:49 
Generaldatatable Pin
arkiboys25-Mar-08 5:12
arkiboys25-Mar-08 5:12 
GeneralRe: datatable Pin
Xmen Real 25-Mar-08 5:34
professional Xmen Real 25-Mar-08 5:34 
GeneralRe: datatable [modified] Pin
arkiboys25-Mar-08 5:46
arkiboys25-Mar-08 5:46 
GeneralListView Single Range Selection Pin
Echilon25-Mar-08 4:27
Echilon25-Mar-08 4:27 
GeneralRe: ListView Single Range Selection Pin
Xmen Real 25-Mar-08 5:36
professional Xmen Real 25-Mar-08 5:36 
QuestionHow can i found which process access my file? Pin
Ambarish Jana25-Mar-08 3:58
Ambarish Jana25-Mar-08 3:58 
AnswerRe: How can i found which process access my file? Pin
Rob Philpott25-Mar-08 5:10
Rob Philpott25-Mar-08 5:10 
GeneralRe: How can i found which process access my file? Pin
Giorgi Dalakishvili25-Mar-08 7:53
mentorGiorgi Dalakishvili25-Mar-08 7:53 
Generalcopy listbox items Pin
NewToAspDotNet25-Mar-08 3:41
NewToAspDotNet25-Mar-08 3:41 
GeneralRe: copy listbox items Pin
Gareth H25-Mar-08 4:16
Gareth H25-Mar-08 4:16 
GeneralRe: copy listbox items Pin
partialdata18-Aug-09 17:31
partialdata18-Aug-09 17:31 
Generalenum problem in C# Pin
salon25-Mar-08 3:13
salon25-Mar-08 3:13 
GeneralRe: enum problem in C# Pin
Russell Jones25-Mar-08 3:48
Russell Jones25-Mar-08 3:48 
GeneralRe: enum problem in C# Pin
Gareth H25-Mar-08 3:59
Gareth H25-Mar-08 3:59 

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.