Click here to Skip to main content
15,914,165 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sorting DataGrid from DataView Problems Pin
sreejith ss nair28-Oct-04 18:38
sreejith ss nair28-Oct-04 18:38 
GeneralRe: Sorting DataGrid from DataView Problems Pin
Rebecca Gao28-Oct-04 20:39
Rebecca Gao28-Oct-04 20:39 
GeneralRe: Sorting DataGrid from DataView Problems Pin
sreejith ss nair28-Oct-04 22:57
sreejith ss nair28-Oct-04 22:57 
GeneralRe: Sorting DataGrid from DataView Problems Pin
Rebecca Gao29-Oct-04 4:02
Rebecca Gao29-Oct-04 4:02 
Generalforms maximize and minimum Pin
webhay28-Oct-04 16:05
webhay28-Oct-04 16:05 
GeneralRe: forms maximize and minimum Pin
Heath Stewart28-Oct-04 16:16
protectorHeath Stewart28-Oct-04 16:16 
GeneralGDI+ usercontrol problem Pin
bobrad28-Oct-04 15:44
bobrad28-Oct-04 15:44 
GeneralRe: GDI+ usercontrol problem Pin
Heath Stewart28-Oct-04 16:32
protectorHeath Stewart28-Oct-04 16:32 
Painting and other interaction with the control happens in the same thread (by default), and most likely your painting routines are far too slow to keep up (so you get the appearance on-screen bitmap staying place). While you're moving the control, you're blocking the thread so the painting isn't even performed (the reason the controls move is because they encapsulate the native Windows APIs - and in most cases the Windows Common Controls - which are programmed to paint correctly in a separate thread...which is exactly what you're going to do if you follow this advice.

In our defualt constructor, call the following:
SetStyle(ControlStyles.AllPaintingInWmPaint |
  ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);
Now you're responsible for all drawing (even the background), but it sounds like you're doing that already. Additionally, the .NET Framework - without any additional code on your part - is performing the paint routine in a separate thread and copying that secondary graphics buffer to the on-screen buffer when it can. This will elliminate the flicker (mostly; terribly inefficient paint routines may still cause flicker so honor the PaintEventArgs.ClipRectangle and only redraw what's necessary) and should provide a more consistent, contiquous painting experience while dragging your windows.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: GDI+ usercontrol problem Pin
bobrad28-Oct-04 17:10
bobrad28-Oct-04 17:10 
GeneralRe: GDI+ usercontrol problem Pin
Heath Stewart29-Oct-04 5:37
protectorHeath Stewart29-Oct-04 5:37 
GeneralRe: GDI+ usercontrol problem Pin
bobrad29-Oct-04 6:07
bobrad29-Oct-04 6:07 
GeneralRe: GDI+ usercontrol problem Pin
Heath Stewart30-Oct-04 2:22
protectorHeath Stewart30-Oct-04 2:22 
Generalbind datagrid to a variable Pin
xiaowenjie28-Oct-04 15:29
xiaowenjie28-Oct-04 15:29 
GeneralRe: bind datagrid to a variable Pin
Heath Stewart28-Oct-04 16:13
protectorHeath Stewart28-Oct-04 16:13 
GeneralRe: bind datagrid to a variable Pin
xiaowenjie28-Oct-04 19:08
xiaowenjie28-Oct-04 19:08 
GeneralRe: bind datagrid to a variable Pin
Heath Stewart29-Oct-04 5:38
protectorHeath Stewart29-Oct-04 5:38 
GeneralRe: bind datagrid to a variable Pin
xiaowenjie29-Oct-04 6:15
xiaowenjie29-Oct-04 6:15 
GeneralRe: bind datagrid to a variable Pin
xiaowenjie29-Oct-04 6:29
xiaowenjie29-Oct-04 6:29 
GeneralRe: bind datagrid to a variable Pin
Heath Stewart30-Oct-04 2:58
protectorHeath Stewart30-Oct-04 2:58 
GeneralCOM Interopability problem Pin
iliyang28-Oct-04 10:57
iliyang28-Oct-04 10:57 
GeneralRe: COM Interopability problem Pin
Heath Stewart28-Oct-04 16:04
protectorHeath Stewart28-Oct-04 16:04 
QuestionKeeping context menu open even after clicking? Pin
Carl Mercier28-Oct-04 9:29
Carl Mercier28-Oct-04 9:29 
AnswerRe: Keeping context menu open even after clicking? Pin
Heath Stewart28-Oct-04 15:58
protectorHeath Stewart28-Oct-04 15:58 
GeneralRe: Keeping context menu open even after clicking? Pin
Carl Mercier29-Oct-04 3:50
Carl Mercier29-Oct-04 3:50 
GeneralRe: Keeping context menu open even after clicking? Pin
LongRange.Shooter29-Oct-04 6:50
LongRange.Shooter29-Oct-04 6:50 

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.