Recent

Author Topic: WM_NCCALCSIZE, WM_NCPAINT don't fire in the Lazarus  (Read 3547 times)

dmitryb

  • Jr. Member
  • **
  • Posts: 50
WM_NCCALCSIZE, WM_NCPAINT don't fire in the Lazarus
« on: May 19, 2014, 11:01:38 am »
Hi All

How to create custom frame for control

In Delphi I used WM_NCCALCSIZE to change frame size and WM_NCPAINT to draw the Frame

Code: [Select]
procedure TCustomDBAxisGridEh.WMNCCalcSize(var Message: TWMNCCalcSize);
begin
  inherited;
  with Message.CalcSize_Params^ do
  begin
    if ebLeft in Border.EdgeBorders then
      Inc(rgrc[0].Left, FBorderWidth);
    if ebTop in Border.EdgeBorders then
      Inc(rgrc[0].Top, FBorderWidth);
    if ebRight in Border.EdgeBorders then
      Dec(rgrc[0].Right, FBorderWidth);
    if ebBottom in Border.EdgeBorders then
      Dec(rgrc[0].Bottom, FBorderWidth);
  end;
end;

procedure TCustomDBAxisGridEh.WMNCPaint(var Message: TWMNCPaint);
begin
  inherited;
  DrawBorder;
end;

But in Lazarus its seems not fires.
« Last Edit: May 20, 2014, 07:54:02 pm by dmitryb »

CCRDude

  • Hero Member
  • *****
  • Posts: 535
Re: WM_NCCALCSIZE, WM_NCPAINT don't fire in the Lazarus
« Reply #1 on: March 28, 2022, 05:49:14 pm »
I know this is an old post, just wanted to add a solution for anyone stumbling across this post during a search.
This forum post shows how to receive additional messages (on Windows)

 

TinyPortal © 2005-2018