全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:848
推到 Plurk!
推到 Facebook!

陌生的 Delphi

 
James
高階會員


發表:10
回覆:290
積分:220
註冊:2002-07-25

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-01-04 22:42:48 IP:218.162.xxx.xxx 未訂閱
這幾天在朋友那看了一下 Delhi 8 的畫面和一些程式碼, 差一點暈倒... 一個簡單的 Hello world , 怎麼變得如此的陌生 ,跟朋友要了一下程式碼回 來看看 ,跟大家分享一下。    看了之後, 真不知道該不該繼續往 Delphi.Net 走下去了...
unit WinForm;    interface    uses
  System.Drawing, System.Collections, System.ComponentModel,
  System.Windows.Forms, System.Data;    type
  TWinForm = class(System.Windows.Forms.Form)
  {$REGION 'Designer Managed Code'}
  strict private
    /// 
    /// Required designer variable.
    /// 
    Components: System.ComponentModel.Container;
    Button1: System.Windows.Forms.Button;
    /// 
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// 
    procedure InitializeComponent;
    procedure Button1_Click(sender: System.Object; e: System.EventArgs);
  {$ENDREGION}
  strict protected
    /// 
    /// Clean up any resources being used.
    /// 
    procedure Dispose(Disposing: Boolean); override;
  private
    { Private Declarations }
  public
    constructor Create;
  end;      [assembly: RuntimeRequiredAttribute(TypeOf(TWinForm))]    implementation    {$REGION 'Windows Form Designer generated code'}
/// 
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// 
procedure TWinForm.InitializeComponent;
begin
  Self.Button1 := System.Windows.Forms.Button.Create;
  Self.SuspendLayout;
  // 
  // Button1
  // 
  Self.Button1.Location := System.Drawing.Point.Create(96, 96);
  Self.Button1.Name := 'Button1';
  Self.Button1.TabIndex := 0;
  Self.Button1.Text := 'Button1';
  Include(Self.Button1.Click, Self.Button1_Click);
  // 
  // TWinForm
  // 
  Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 15);
  Self.ClientSize := System.Drawing.Size.Create(292, 273);
  Self.Controls.Add(Self.Button1);
  Self.Name := 'TWinForm';
  Self.Text := 'WinForm';
  Self.ResumeLayout(False);
end;
{$ENDREGION}    procedure TWinForm.Dispose(Disposing: Boolean);
begin
  if Disposing then
  begin
    if Components <> nil then
      Components.Dispose();
  end;
  inherited Dispose(Disposing);
end;    constructor TWinForm.Create;
begin
  inherited Create;
  //
  // Required for Windows Form Designer support
  //
  InitializeComponent;
  //
  // TODO: Add any constructor code after InitializeComponent call
  //
end;    procedure TWinForm.Button1_Click(sender: System.Object; e: System.EventArgs);
begin
  MessageBox.Show('Hello world');
end;    end.
tinochen
一般會員


發表:0
回覆:18
積分:8
註冊:2002-07-16

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-01-05 01:25:35 IP:218.163.xxx.xxx 未訂閱
引言: 這幾天在朋友那看了一下 Delhi 8 的畫面和一些程式碼, 差一點暈倒... 一個簡單的 Hello world , 怎麼變得如此的陌生 ,跟朋友要了一下程式碼回 來看看 ,跟大家分享一下。 看了之後, 真不知道該不該繼續往 Delphi.Net 走下去了...
其實感覺並不陌生,只是把以前delphi寫在 .dfm 中的東西移出來而已,且很多應該也是delphi幫我們產生出來的,這語法是配合 .NET 自然也就要use一些 .NET的API,就和我們以前use一些Win 32API來用差不多,所以個人覺得還是可以繼續走下去。又不然去學VB.NET or C#.NET 也是差不多的架構。先想像一下用Delphi寫,NET的Web Form感覺就很快樂...當然也可以寫一般Win 32的程式感覺就沒那麼麻煩,但就沒Web Form的功能..
pgdennis
資深會員


發表:41
回覆:526
積分:443
註冊:2002-05-23

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-01-05 09:36:43 IP:218.163.xxx.xxx 未訂閱
不走下去不行...要玩windows平台,還是要過這關 你列的code應該是WinForm,不是VclForm,用WinForm是 用.NET原生的lib,感覺就比較陌生,但他就跟VS.net產生的CODE幾乎一模一樣 差只差在兩方IDE工具使用上的差別,例如delphi的WIZARD就比VS的好用..且強多了 反正大部分的code都是IDE幫你產生的..如果你將自動產生的code隱藏起來 就會發現..其實也沒有多很多code... 反正. >... 而且寫 >不過不知道 > 永遠追不上技術更新的速度
------
星期一,二...無窮迴圈@@
James
高階會員


發表:10
回覆:290
積分:220
註冊:2002-07-25

發送簡訊給我
#4 引用回覆 回覆 發表時間:2004-01-05 09:45:12 IP:61.218.xxx.xxx 未訂閱
如果把同樣的功能, 改成用 C# or VB.Net 去寫的話, 還真的如您所言, 不論是 xxx.Net, 還真的都是同樣的, 整個感覺上就像是披了羊皮的狼, 從 IDE 環境上已經看不出他像是 Delphi, 在看到所要寫的程式碼, 甚至按了 Help 的按鈕所跳出來的 Help 文檔, 可能 真的是人老了 ,忽然之間從 D1~D7 的熟悉感覺不見了,很多東西都要重悉適應。 只是這下不知道會不會害一些以往寫 Delphi 書的作者頭痛了, 以往改改畫面就可以從 2->3 , 加一些新的東西又可以從 3->4 , 4->5.... ,這下從 D7->D8 , 這可能要去看看 VB.Net or C# 的作者要不要來寫了, 或許他們可以把 IDE 環境換一換 ,就可以從 VB.Net 換成 Delphi.Net 了。 然而 ,如果要寫 Win32 的程式, 那還有必要換到 Delphi 8 嘛 ?! 速度, 效能, 便利...等 因素的考量下, 似乎回歸傳統的 Delphi 6 or 7 會更方便, 甚至一些以往使用不錯的 VCL 套件或者是 Expert,能不能順利的轉到 D8 上面,也似乎是另外一個隱憂 !!!
系統時間:2024-05-18 16:24:26
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!