c0smyn Posted January 7, 2009 Report Share Posted January 7, 2009 Un mod mult mai simplu pentru a folosi sistemul de mesaje in Borland DelphiPuneti acest cod sub " {$R *.dfm} "procedure ArataMesaj(mesaj: string; titlu: string; tip: Integer);vareroare,informatie,exclamatie,intrebare,normal: boolean;beginif tip > 5 then exitelseif tip < 1 then exit;eroare := false;informatie := false;exclamatie := false;normal := false;intrebare := false;{Setare tip mesaj} //begin if tip = 1 then eroare := true; if tip = 2 then informatie := true; if tip = 3 then exclamatie := true; if tip = 4 then normal := true; if tip = 5 then intrebare := true;{Setare tip mesaj} //end;if eroare = true then MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK +mb_ICONERROR)elseif informatie = true then MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK +mb_ICONINFORMATION)elseif exclamatie = true then MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK +mb_ICONEXCLAMATION)elseif normal = true then MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK)elseif intrebare = true then MessageBox(application.handle,Pchar(mesaj),Pchar(titlu), +mb_OK +mb_ICONQUESTION);end;Noua comanda va fi ArataMesaj(string,string,integer);Exemplu:ArataMesaj('Nu imi place scoala!','Rst Center',2);"Nu imi place scoala" - reprezinta mesajul care v`a fi afisat"Rst Center" - reprezinta titlul mesajului"2" - reprezinta tipul de mesaj (2 = mesaj de tip informatie)Tipurile de mesaj:1 - Mesaj eroare2 - Mesaj informatie3 - Mesaj exclamatie4 - Mesaj normal5 - Mesaj intrebareEnjoy Quote Link to comment Share on other sites More sharing options...
mp4 Posted July 2, 2009 Report Share Posted July 2, 2009 folositorBravo cosmin. Quote Link to comment Share on other sites More sharing options...