Solved

style property of TWndClass

Posted on 2002-05-02
5
389 Views
Last Modified: 2008-03-17
Hi there,

I use regular mdi child forms in my program. I create these forms by using Application.Createform. Now I want to set the style property of the TWndClass for these mdi child forms like this:

style := CS_HREDRAW or CS_VREDRAW or CS_OWNDC;

But as far as I know, we only use TWndClass in Win32 applications. How do I set this style property in VCL application???

Bye,
Jeroen
0
Comment
Question by:jccommandeur
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6987783
SetWindowLong(Handle, GWL_STYLE, CS_HREDRAW or CS_VREDRAW or CS_OWNDC);
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6987784
put it after OnCreate... or perhaps in OnShow? forgot which one, hehehe :)
0
 
LVL 8

Accepted Solution

by:
TOndrej earned 100 total points
ID: 6988496
You can simply override CreateParams in your MDI child forms:

type
  TMyMDIChildForm = class(TForm)
  ...
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  end;

procedure TMyMDIChildForm.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  with Params do
    WindowClass.style := CS_HREDRAW or CS_VREDRAW or CS_OWNDC;
end;

HTH
TOndrej
0
 

Author Comment

by:jccommandeur
ID: 6989536
Thanks, that was indeed what I was looking for. Do I need to register the class also?

Jeroen
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 6989639
You don't have to register the class, VCL does it for you.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month5 days, 12 hours left to enroll

627 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