Einzelnen Beitrag anzeigen

Benutzerbild von Amnon82
Amnon82

Registriert seit: 5. Jan 2005
186 Beiträge
 
FreePascal / Lazarus
 
#3

Re: MessageDLG mit eigener Überschrift, Wie?

  Alt 10. Mai 2006, 10:15
Hab auch was gefunden:

http://img96.imageshack.us/img96/4356/dialogs6nq.png

Delphi-Quellcode:
MsgBox(
    STR Msg, // address of text in message box
    STR Caption, // address of title of message box
    BOOL Silent // determine muted sound
    INT uType // style of message box
   );

MsgBoxEX(
    STR Msg, // address of text in message box
    STR Caption, // address of title of message box
    TPIC MsgPic // address of icon to show in the message box
    TIMGLST GlyphList // address of imagelist to representing button glyphs
    TPOS Position // position of message box
    STR Buttons // adress of ButtonCaptions
    STR Sound // adress of sound to play when opening the message box
    BOOL StayOnTop // formstyle of message box
    BOOL SetForeGround // determine if message box becomes the foreground
                             window.
    TCOLOR Color // set the color of the message box
    BYTE DefaultButton // sets the default button in the message box
   );
Example on how to display a message box with red fonts in message,
yesnobuttons, yesbutton's caption = 'Yeah', display a questionicon,
and default button is 2:

Delphi-Quellcode:
 Var ReturnValue : Integer;

 Procedure Sample1;
 begin
   mb_BtnYes := '&Yeah';
   mb_MsgFont := Tfont.Create;
   mb_MsgFont.Color := clRed;
   ReturnValue := MsgBox( 'This is the red message', '', False,
    MB_YESNO or MB_DEFBUTTON2 or MB_ICONQUESTION);
   mb_MsgFont.Free;
 end;

Example on how to display a simple message box asking for a value
from 1 to 10 represented by buttons 1 to 10, playing the soundfile
"c:\woww.wav", where default button is 5:

Delphi-Quellcode:
 Var ReturnValue : Integer;

 Procedure sample2;
 begin
   ReturnValue := MsgBoxEX('Select a value from 1 to 10', '', nil, nil,
   poOwnerFormCenter, '1|2|3|4|5|6|7|8|9|10', 'c:\woww.wav', False, False,
   clBtnFace, 5);
 end;
Angehängte Dateien
Dateityp: zip msgbox__and_statusbox_736.zip (27,3 KB, 20x aufgerufen)
  Mit Zitat antworten Zitat