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
Solved

style property of TWndClass

Posted on 2002-05-02
5
383 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
  • 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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Syntax Check Delphi Seattle IOS app without MAC ? 1 105
Help on project with Soap 10 57
Delphi XE10 Round Image 2 158
Breakpoint doesn't stop in my variable 3 30
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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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