Board index » delphi » Delphi 3: Speedbuttons on borderless forms...

Delphi 3: Speedbuttons on borderless forms...

I have created a borderless form in delphi 3 that allows you to move it by
clicking in the client area using wm_NCHitTest.  Unfortunatly this means
that the speedbuttons are not clickable, although normal buttons are.  I
need to use the speed button though as I want the flat style button.  How
can I make the button work again or change the form moving area to just an
area at the top of the form without having a caption bar?
Thanks in advance

Pepitoe
pepitoe2...@hotmail.com

 

Re:Delphi 3: Speedbuttons on borderless forms...


I have created a borderless form in delphi 3 that allows you to move it by
clicking in the client area using wm_NCHitTest.  Unfortunatly this means
that the speedbuttons are not clickable, although normal buttons are.  I
need to use the speed button though as I want the flat style button.  How
can I make the button work again or change the form moving area to just an
area at the top of the form without having a caption bar?
Thanks in advance

Pepitoe
pepitoe2...@hotmail.com

Re:Delphi 3: Speedbuttons on borderless forms...


I have created a borderless form in delphi 3 that allows you to move it by
clicking in the client area using wm_NCHitTest.  Unfortunatly this means
that the speedbuttons are not clickable, although normal buttons are.  I
need to use the speed button though as I want the flat style button.  How
can I make the button work again or change the form moving area to just an
area at the top of the form without having a caption bar?
Thanks in advance

Pepitoe
pepitoe2...@hotmail.com

Re:Delphi 3: Speedbuttons on borderless forms...


  Try moving it this way (copied from Delphi3000.com).  The
speedbutton worked when I test it:
--------------------------------------------------------------------
var
  X1, Y1: Integer;

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  {Set start coordinates}
  X1 := X;
  Y1 := Y;
end;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  {Check if left button is down}
  if HiWord(GetAsyncKeyState(VK_LBUTTON)) > 0 then
  begin
    Form1.Left := Form1.Left + X - X1;
    Form1.Top := Form1.Top + Y - Y1;
  end;
end;
--------------------------------------------------------------------

Quote
Pepitoe wrote:

> I have created a borderless form in delphi 3 that allows you to move it by
> clicking in the client area using wm_NCHitTest.  Unfortunatly this means
> that the speedbuttons are not clickable, although normal buttons are.  I
> need to use the speed button though as I want the flat style button.  How
> can I make the button work again or change the form moving area to just an
> area at the top of the form without having a caption bar?
> Thanks in advance

> Pepitoe
> pepitoe2...@hotmail.com

Other Threads