大家好,
我想将edit中的数字在memo中用16进制显示,该如何做?
谢谢了

解决方案 »

  1.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Edit1: TEdit;
        Button1: TButton;
        Memo1: TMemo;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
     memo1.text := '$'+IntToHex(StrToInt(Edit1.Text),2 );
    end;end.
      

  2.   


    var
      I: Integer;
    begin
      I := 10;
      Memo1.Lines.Add(IntToHex(i, 16));
    end;