Einzelnen Beitrag anzeigen

Benutzerbild von 010101
010101

Registriert seit: 27. Nov 2014
34 Beiträge
 
#9

AW: Titelleiste / Rahmen der MessageDlg ausblenden

  Alt 1. Dez 2014, 15:12
Delphi-Quellcode:
function MsgBox(psCaption: string; psText: string; nHeigth: Integer; aMsgDlgType: TMsgDlgType; aMsgDlgBtn: TMsgDlgButtons; aMsgDlgBtnDef: TMsgDlgBtn): Integer;
var
  iModalRes: Integer;
begin
  iModalRes := ID_NO;

  aMsgDialog := CreateMessageDialog(psText, aMsgDlgType, aMsgDlgBtn, aMsgDlgBtnDef);

  with aMsgDialog do
    begin
      BringToFront;
           
      Caption := psCaption;
      ClientHeight := nHeigth;
      BorderIcons := []; // Keine Border-Icons
      BorderStyle := bsNone; // Keine Titelleiste
      FormStyle := fsStayOnTop;

      Top := (Screen.Height div 2) - (Height div 2);
      SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
           
      iModalRes := ShowModal;

      Free;
    end;

  Result := iModalRes;
end;

// Aufruf:
case MsgBox('Caption', 'Text', 100, mtInformation, [mbYes, mbNo, mbClose], mbNo) of
  ID_YES: ;
  ID_NO: ;
  ID_CLOSE: ;
end;

und wie bekomme ich den code in den aufruf von der TApplication eines buttons.

wenn das bei dir in einer leeren form geht, kannst die mir mal posten.


mfg
  Mit Zitat antworten Zitat