Einzelnen Beitrag anzeigen

hathor
(Gast)

n/a Beiträge
 
#5

AW: Kontextsensitive Hilfe / biHelp-Button trotz Minimize-Button?

  Alt 20. Dez 2015, 15:25
Man könnte es umschaltbar machen:
Delphi-Quellcode:
  protected
    procedure WMNCLButtonDown(var Message: TWMNCLButtonDown); message WM_NCLBUTTONDOWN;
  end;

var
  Form1: TForm1;
  switched : Boolean;

implementation

{$R *.dfm}

procedure TForm1.WMNCLButtonDown(var Message: TWMNCLButtonDown);
begin
  if (Message.HitTest = HTCAPTION) then
  BEGIN
  if switched=TRUE then
  begin
    BorderIcons := [biSystemMenu,biMinimize,biHelp];
    BorderIcons := BorderIcons - [biMinimize];
    switched:=FALSE;
  end else
  begin
    BorderIcons := [biSystemMenu,biMinimize,biHelp];
    BorderIcons := BorderIcons - [biHelp];
    switched:=TRUE;
  end;
  END;
  if (Message.HitTest = HTCLOSE) then Application.Terminate;
  if (Message.HitTest = HTHELP) then
  begin ShowMessage('hello world'); message.Result := 0; end
  else inherited;
end;
  Mit Zitat antworten Zitat