PDA

View Full Version : سوال: dialogBox بدون Button ؟؟؟



BORHAN TEC
دوشنبه 29 اسفند 1390, 16:54 عصر
سلام
چگونه می توان از تابع messageBox به گونه ای استفاده کرد که پیام ظاهر شده هیچ دکمه ای نداشته باشد؟
موفق باشید...

بهروز عباسی
دوشنبه 29 اسفند 1390, 17:03 عصر
سلام
چگونه می توان از تابع messageBox به گونه ای استفاده کرد که پیام ظاهر شده هیچ دکمه ای نداشته باشد؟
موفق باشید...
اگه خیلی برات مهم نیست که از این تابع استفاده کنی یه فرم برا ینمایش پیفام بسازوازش استفاده کن
شرمنده اگه ایده مضخرفیه:لبخند:

سعید صابری
دوشنبه 29 اسفند 1390, 21:34 عصر
function MyMessageDialog(const Msg: string; DlgType: TMsgDlgType;

Buttons: TMsgDlgButtons; Captions: array of string): Integer;

var

aMsgDlg: TForm;

i: Integer;

dlgButton: TButton;

CaptionIndex: Integer;

begin

{ Create the Dialog }

aMsgDlg := CreateMessageDialog(Msg, DlgType, Buttons);

captionIndex := 0;

{ Loop through Objects in Dialog }

for i := 0 to aMsgDlg.ComponentCount - 1 do

begin

{ If the object is of type TButton, then }

if (aMsgDlg.Components[i] is TButton) then

begin

dlgButton := TButton(aMsgDlg.Components[i]);

if CaptionIndex > High(Captions) then Break;

{ Give a new caption from our Captions array}

dlgButton.Caption := Captions[CaptionIndex];

Inc(CaptionIndex);

end;

end;

Result := aMsgDlg.ShowModal;

end;



{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin

MyMessageDialog('saeed',mtWarning,[],[])
end;

fahimi
دوشنبه 29 اسفند 1390, 22:19 عصر
در این صورت نیاز به تایمر جهت پایان نمایش پیام می باشد