如题

解决方案 »

  1.   

    你是指显示提示信息是变量的值?var
      ddf: string;
    begin
      ddf:= 'asdfdsasdf';
      Application.MessageBox(Pansichar(ddf),'afds',36+256);
    end;
      

  2.   

    可以。messagebox显示的是字符串。
    整数,浮点数转换一下就行。
      

  3.   


    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
      I:Integer;
      Tot:Integer;
    begin
      I:=0;
      Tot:=0;
      for  i:=0  to 10 do
      begin
         Tot:=Tot+i
      end;
      showMessage(IntToStr(Tot));
    end;
    end.我要Delphi的For循环演示了showMessage()可以显示变量的。红色区域是主要代码。
      

  4.   

    procedure TForm2.Button1Click(Sender: TObject);
    var
      strvalue : string;
    begin
      strvalue:= Edit1.Text; //字符变量
      MessageBox(Handle,pchar(strvalue),'友情提示',MB_OK or MB_ICONHAND);
    end;end.
      

  5.   


    var 
      I:Integer; 
      Tot:Integer; 
    begin 
      I:=0; 
      Tot:=0; 
      for  i:=0  to 10 do 
      begin 
        Tot:=Tot+i 
      end; 
      showMessage(IntToStr(Tot)); 
    end;