Click here to Skip to main content
15,920,836 members
Home / Discussions / C#
   

C#

 
GeneralRe: Webconfig question Pin
Heath Stewart20-Apr-04 5:09
protectorHeath Stewart20-Apr-04 5:09 
Questionshowing dialog with topLevel ? Pin
azusakt19-Apr-04 17:45
azusakt19-Apr-04 17:45 
AnswerRe: showing dialog with topLevel ? Pin
LongRange.Shooter20-Apr-04 2:35
LongRange.Shooter20-Apr-04 2:35 
AnswerRe: showing dialog with topLevel ? Pin
Heath Stewart20-Apr-04 5:05
protectorHeath Stewart20-Apr-04 5:05 
GeneralRe: showing dialog with topLevel ? Pin
azusakt20-Apr-04 16:31
azusakt20-Apr-04 16:31 
GeneralRe: showing dialog with topLevel ? Pin
Heath Stewart21-Apr-04 3:04
protectorHeath Stewart21-Apr-04 3:04 
GeneralMDI Child Form Drag Without Toolbar Pin
Cyric7419-Apr-04 16:34
Cyric7419-Apr-04 16:34 
GeneralRe: MDI Child Form Drag Without Toolbar Pin
Heath Stewart20-Apr-04 5:02
protectorHeath Stewart20-Apr-04 5:02 
I'm not sure how you're doing it now, but basically set a flag in the MouseDownm event handler (or better, override OnMouseDown, which also is better for the other events I'll mention - just don't forget to call base.OnEventName). In the MouseMove handler move your form only if the flag is set. Finally, in the MouseUp handler reset the flag.

While moving the form, you have a couple of choices. You can simply set the Location property but that is what is most likely causing your lag (and related problems). There's quite a bit that happens in the implementation for setting the Location property. In the MouseDown handler, it might be better to call SuspendLayout and then call ResumeLayout in the MouseUp handler. I haven't tried this so I don't know how well this will work, and it may not even display the form while dragging.

You might instead consider P/Invoking the SetWindowPos API, which you can find more information about in the Platform SDK documentation in the MSDN Library[^]. This should result in much faster code and should eliminate that lag you're experiencing.

 

Microsoft MVP, Visual C#
My Articles
QuestionCombining serialization of collection and internal data? Pin
Anonymous19-Apr-04 16:25
Anonymous19-Apr-04 16:25 
AnswerRe: Combining serialization of collection and internal data? Pin
Heath Stewart20-Apr-04 4:56
protectorHeath Stewart20-Apr-04 4:56 
GeneralWindows Messages Pin
T i T i19-Apr-04 14:22
T i T i19-Apr-04 14:22 
GeneralRe: Windows Messages Pin
Roman Rodov19-Apr-04 14:57
Roman Rodov19-Apr-04 14:57 
GeneralC# #define macro equivalent. Pin
HAHAHA_NEXT19-Apr-04 11:47
HAHAHA_NEXT19-Apr-04 11:47 
GeneralRe: C# #define macro equivalent. Pin
Mikko Puonti19-Apr-04 13:01
Mikko Puonti19-Apr-04 13:01 
GeneralRe: C# #define macro equivalent. Pin
HAHAHA_NEXT20-Apr-04 6:31
HAHAHA_NEXT20-Apr-04 6:31 
GeneralRe: C# #define macro equivalent. Pin
leppie20-Apr-04 7:05
leppie20-Apr-04 7:05 
GeneralRedraw scrollbars of TreeView Pin
Jean Bédard19-Apr-04 9:54
Jean Bédard19-Apr-04 9:54 
GeneralThreadPool Class Pin
Spiros19-Apr-04 8:58
Spiros19-Apr-04 8:58 
GeneralRe: ThreadPool Class Pin
Heath Stewart19-Apr-04 9:14
protectorHeath Stewart19-Apr-04 9:14 
GeneralRe: ThreadPool Class Pin
dabuskol19-Apr-04 19:02
dabuskol19-Apr-04 19:02 
GeneralAPI (GetPrivateProfileString) does not understand extention. Pin
mcgahanfl19-Apr-04 8:57
mcgahanfl19-Apr-04 8:57 
Questionhow to add function to Explorer's context menu Pin
Paolo Ponzano19-Apr-04 8:40
Paolo Ponzano19-Apr-04 8:40 
AnswerRe: how to add function to Explorer's context menu Pin
Heath Stewart19-Apr-04 8:54
protectorHeath Stewart19-Apr-04 8:54 
AnswerRe: how to add function to Explorer's context menu Pin
Mike Dimmick19-Apr-04 8:55
Mike Dimmick19-Apr-04 8:55 
AnswerRe: how to add function to Explorer's context menu Pin
Heath Stewart19-Apr-04 8:57
protectorHeath Stewart19-Apr-04 8:57 

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.