Solved

Do not Repaint !  :-)

Posted on 1999-01-25
7
279 Views
Last Modified: 2010-04-04
D4, W98, Paradox
Hello all,
  How could i tell Windows do not repaint a componant until I want ?
  I am creating a TCalendar component
  My component's ancestor is TPanel and had 350 TButons on it. Buttons size and height are proportionals to TCalendar's ones one. But when 1 change size and height of the TCalendar, the butons are painted once fot changing Height and once again when changing width.
  so question is : How could i tell Windows do not repaint a componant until I want ?

Regards, ans thanks a lot for help.
 
     HelpMe
0
Comment
Question by:helpme020897
  • 2
  • 2
  • 2
  • +1
7 Comments
 

Author Comment

by:helpme020897
ID: 1363277
read " But when I change" instead of  "But when 1 change".
   Thx.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1363278
Why not using TCalendar.SetBounds(left,top,newWidth,newHeight) instead of changing width and height seperately?

Regards, Madshi.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1363279
Or you can use
  SendMessage(calendar1.handle, WM_SETREDRAW, 0, 0);
to prevent redrawing and
  SendMessage(calendar1.handle, WM_SETREDRAW, 1, 0);
to allow it again.

Does this help?

Regards, Madshi.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 7

Expert Comment

by:BlackMan
ID: 1363280
You can freeze the entire window by using LockWindowUpdate(MyForm.Handle).
Use LockWindowUpdate(0) to release
0
 
LVL 3

Expert Comment

by:williams2
ID: 1363281
If I were you I would rather override the components OnPaint procedure instead for handling more customdefined ownerdraw methods.

Regards,
Williams
0
 

Author Comment

by:helpme020897
ID: 1363282
Thanks to each of you.

 But i used BlackMan's solution and it works fine :-)
Please BlackMan lock this question and let me give your benefits. :-)

  HelpMe
0
 
LVL 7

Accepted Solution

by:
BlackMan earned 50 total points
ID: 1363283
:-)

You can freeze the entire window by using LockWindowUpdate(MyForm.Handle).
Use LockWindowUpdate(0) to release
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question