Tutorials to .com

Tutorials to .com » Software » Delphi » Old friends return - delphi2005 Trial Notes 1

Old friends return - delphi2005 Trial Notes 1

Print View , by: iSee ,Total views: 18 ,Word Count: 2479 ,Date: Sat, 22 Aug 2009 Time: 4:07 PM

Sequence

delphi up to 8 o'clock, I have installed. At that time, the first impression is disappointing, because missing a familiar visual vcl; then a feeling is strange, because delphi change its code, something we have to follow the MS to write the. Net namespace work. More importantly, I am using delphi to do b / s the development of no confidence. Good of sorts for a while, I turn to the java platform.

office: office "/>

But later, I saw asp. NET is really very good, but delphi can achieve it, which I have a wish to see an old friend back to the impulse. However, no time to study, so also do not really understand. I IntraWeb and asp. NET is very interested in the realization of the two and would like to try. Later, c # builder1.0 trial borland place for me to point number with a good impression, but still feel that it is, there is no counterbalance the power of the ms. This reminds me of a cartoon of a word, if you beat the enemy, the best way is to join them.

Today, I am delphi have another attitude. No longer is it harsh to ask the best and fastest, but to their own b / s also useful Delphi, and feel better, and this is enough. As for its appearance and spatial changes in the Delphi 8, I have begun to accept, after all, delphi do not go. Net on the road no.

When I accidentally get sent borland Delphi 2005 trial version, I think a game is popular, as you would very much like to try. However, borland registered too there is no "Chinese characteristics" andZhucejiI went online. D version do not in the habit of users.

(A) Hello World.

Delphi2005 is a integrated environment, including Delphi, C++ #, it seems you can use vb.net, but this is not conventional in the contents of the menu. This I feel borland software for naming a problem, it should be called only borland.net2005, or use delphi development c #, it sounds a bit funny.

First to use delphi write a Hello World Bar. In 2005, the development of delphi There are three different ways, the natural environment are also different. They are:

1 VC LForms application for. NET

2 WindowsForms application for. NET

3 VC LForms Application for Win32.

asp ectratio = "t">


Here are three ways of Hello World.

1 VC LForms Application for. NET

Unit Code:

unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls;

type

TForm1 = class (TForm)

Button1: TButton;

Edit1: TEdit;

procedure Button1Click (Sender: TObject);

private

(Private declarations)

public

(Public declarations)

end;

var

Form1: TForm1;

implementation

($ R *. dfm)

procedure TForm1.Button1Click (Sender: TObject);

begin

edit1.Text: = 'Hello World.';

end;

end.

Form Code:

object Form1: TForm1

Left = 0

Top = 0

Width = 281

Height = 138

Caption = 'Form1'

Color = clBtnFace

Font.Charset = DEFAULT_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'Tahoma'

Font.Style = []

OldCreateOrder = False

PixelsPerInch = 96

TextHeight = 13

object Button1: TButton

Left = 88

Top = 56

Width = 75

Height = 25

Caption = 'Button1'

TabOrder = 0

OnClick = Button1Click

end

object Edit1: TEdit

Left = 8

Top = 8

Width = 249

Height = 21

TabOrder = 1

end

end

It looks, and the development of the former win32 no different. Separate modules and form, respectively, for processing and lasting work. In 2 merging the two work in a pas file in the.

2 WindowsForms Application for. 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

/ / / <summary>

/ / / Required designer variable.

/ / / </ Summary>

Components: System.ComponentModel.Container;

TextBox1: System.Windows.Forms.TextBox;

Button1: System.Windows.Forms.Button;

/ / / <summary>

/ / / Required method for Designer support - do not modify

/ / / The contents of this method with the code editor.

/ / / </ Summary>

procedure InitializeComponent;

procedure Button1_Click (sender: System.Object; e: System.EventArgs);

($ ENDREGION)

strict protected

/ / / <summary>

/ / / Clean up any resources being used.

/ / / </ Summary>

procedure Dispose (Disposing: Boolean); override;

private

(Private Declarations)

public

constructor Create;

end;

[assembly: RuntimeRequiredAttribute (TypeOf (TWinForm))]

implementation

($ AUTOBOX ON)

($ REGION 'Windows Form Designer generated code')

/ / / <summary>

/ / / Required method for Designer support - do not modify

/ / / The contents of this method with the code editor.

/ / / </ Summary>

procedure TWinForm.InitializeComponent;

begin

Self.TextBox1: = System.Windows.Forms.TextBox.Create;

Self.Button1: = System.Windows.Forms.Button.Create;

Self.SuspendLayout;

/ /

/ / TextBox1

/ /

Self.TextBox1.Location: = System.Drawing.Point.Create (72, 40);

Self.TextBox1.Name: = 'TextBox1';

Self.TextBox1.Size: = System.Drawing.Size.Create (152, 21);

Self.TextBox1.TabIndex: = 0;

Self.TextBox1.Text: ='';

/ /

/ / Button1

/ /

Self.Button1.Location: = System.Drawing.Point.Create (80, 160);

Self.Button1.Name: = 'Button1';

Self.Button1.Size: = System.Drawing.Size.Create (136, 32);

Self.Button1.TabIndex: = 1;

Self.Button1.Text: = 'Button1';

Include (Self.Button1.Click, Self.Button1_Click);

/ /

/ / TWinForm

/ /

Self.AutoScaleBaseSize: = System.Drawing.Size.Create (6, 14);

Self.ClientSize: = System.Drawing.Size.Create (292, 273);

Self.Controls.Add (Self.Button1);

Self.Controls.Add (Self.TextBox1);

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

TextBox1.Text: = 'Hello World!';

end;

end.

3 VC LForms Application for Win32.

It's exactly the same code and 1.

Finally, there is written in c # using helloworld. It only. Net a way, because it was born in. Net era.

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

namespace Project1

(

/ / / <summary>

/ / / Summary description for WinForm.

/ / / </ Summary>

public class WinForm: System.Windows.Forms.Form

(

/ / / <summary>

/ / / Required designer variable.

/ / / </ Summary>

private System.ComponentModel.Container components = null;

private System.Windows.Forms.TextBox textBox1;

private System.Windows.Forms.Button button1;

public winform ()

(

/ /

/ / Required for Windows Form Designer support

/ /

InitializeComponent ();

/ /

/ / TODO: Add any constructor code after InitializeComponent call

/ /

)

/ / / <summary>

/ / / Clean up any resources being used.

/ / / </ Summary>

protected override void Dispose (bool disposing)

(

if (disposing)

(

if (components! = null)

(

components.Dispose ();

)

)

base.Dispose (disposing);

)

# region Windows Form Designer generated code

/ / / <summary>

/ / / Required method for Designer support - do not modify

/ / / The contents of this method with the code editor.

/ / / </ Summary>

private void InitializeComponent ()

(

this.textBox1 = new System.Windows.Forms.TextBox ();

this.button1 = new System.Windows.Forms.Button ();

this.SuspendLayout ();

/ /

/ / TextBox1

/ /

this.textBox1.Location = new System.Drawing.Point (72, 88);

this.textBox1.Name = "textBox1";

this.textBox1.Size = new System.Drawing.Size (120, 21);

this.textBox1.TabIndex = 0;

this.textBox1.Text = "textBox1";

this.textBox1.TextChanged + = new System.EventHandler (this.textBox1_TextChanged);

/ /

/ / Button1

/ /

this.button1.Location = new System.Drawing.Point (88, 176);

this.button1.Name = "button1";

this.button1.TabIndex = 1;

this.button1.Text = "button1";

this.button1.Click + = new System.EventHandler (this.button1_Click);

/ /

/ / WinForm

/ /

this.AutoScaleBaseSize = new System.Drawing.Size (6, 14);

this.ClientSize = new System.Drawing.Size (292, 273);

this.Controls.Add (this.button1);

this.Controls.Add (this.textBox1);

this.Name = "WinForm";

this.Text = "WinForm";

this.ResumeLayout (false);

)

# endregion

/ / / <summary>

/ / / The main entry point for the application.

/ / / </ Summary>

[STAThread]

static void office: smarttags "/> Main ()

(

Application.Run (new WinForm ());

)

private void button1_Click (object sender, System.EventArgs e)

(

textBox1.Text = "Hello World.";

)

private void textBox1_TextChanged (object sender, System.EventArgs e)

(

)

)

)

asp ectratio = "t">


Delphi Tutorial Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.