Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to revert to Win 3.1 form resizing behaviour Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
10-Oct-02
Category
System
Language
Delphi 2.x
Views
65
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius 

Has anyone found a way to prevent the Paint method from firing when you're in the 
middle of resizing a form? In other words, is there some way to ghost the change 
until the user actually releases the mouse button, instead of redrawing the form 
constantly during the resize?

Answer:

You can revert to the way a window was resized in Win 3.1 - with a sizing frame and 
a redraw only when the user let go of the mouse.

In your forms declaration you place this:
1   
2   private
3   	{Private declarations}
4   	FDragFullWindowState: LongBool;
5   	procedure WMEnterSizeMove(var msg: TMessage); message WM_ENTERSIZEMOVE;
6   	procedure WMExitSizeMove(var msg: TMessage); message WM_EXITSIZEMOVE;


The implementation is like this:
1   
2   private
3   	{Private declarations}
4   	FDragFullWindowState: LongBool;
5   	procedure WMEnterSizeMove(var msg: TMessage); message WM_ENTERSIZEMOVE;
6   	procedure WMExitSizeMove(var msg: TMessage); message WM_EXITSIZEMOVE;


The implementation is like this:

procedure TProdBuilderMainForm.WMEnterSizeMove(var msg: TMessage);
begin
  SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, @FDragFullWindowState, 0);
  if FDragFullWindowState then
    SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, Ord(False), nil, 0);
end;

procedure TProdBuilderMainForm.WMExitSizeMove(var msg: TMessage);
begin
  if FDragFullWindowState then
    SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, Ord(True), nil, 0);
end;

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC