First contact Delphi

xiaoxiao2021-03-06  14

The first time Delphi is still good, it is the English language is too bad, and many controls inside do not know.

I wrote a chaotic program that can change the form background in the first time.

Unit unit1;

Interface

Uses Windows, Messages, Sysutils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Stdctrls;

type TForm1 = class (TForm) Button1: TButton; Button2: TButton; Button4: TButton; Button5: TButton; Button6: TButton; Button3: TButton; procedure Button1Click (Sender: TObject); procedure Button2Click (Sender: TObject); procedure Button4Click ( Sender: TObject); procedure Button5Click (Sender: TObject); procedure Button6Click (Sender: TObject); procedure Button3Click (Sender: TObject); private {Private declarations} public {public declarations} end;

Var Form1: TFORM1;

IMPLEMENTATION

{$ R * .dfm}

Procedure tForm1.Button1Click (sender: Tobject); beginform1.caption: = 'red background'; // window title form1.color: = CLRED / / Form color change end;

Procedure tform1.button2click (sender: TOBJECT); beginform1.caption: = 'white background'; Form1.Color: = CLWHITEEND;

Procedure tform1.button4click (sender: TOBJECT); beginform1.caption: = 'blue background'; form1.color: = CLBLUEEND;

Procedure tform1.button5click (sender: TOBJECT); beginform1.caption: = 'yellow background'; Form1.Color: = Clyellownd;

Procedure TFORM1.BUTTON6CLICK (Sender: TOBJECT); Beginform1.caption: = 'Green Background'; Form1.Color: = CLGREENEND;

Procedure TFORM1.BUTTON3CLICK (Sender: TOBJECT); beginform1.closend;

End.

The first time I used it to compose a small code, and I was still very happy.

转载请注明原文地址:https://www.9cbs.com/read-47865.html

New Post(0)