.


:




:

































 

 

 

 


қ ұ 6




қ құ. TTimer, Tshape құ

 

. ң ө, қ құ.

1. System Form1 ғ Timer Timer1 қ. 55- OnTimer қғ, ұ Shape2 ү қ. 55- ә, Interval қ әү ә құғ .

 

2.Additional Form1 ғ Shape Shape1 қ. ң қ ө ә қ:

Shape- stCircle, Height -121, Width 121,

Left 240,

Top 104.

3.Form1 ғ Shape Shape2 қ. ң қ ө ә қ:

Shape stCircle, Height -41, Width 41,

Left 400,

Top 152.

 


4. Form1 ң ө ғ Label Label1 . ң Caption қ- ә . Font қ , қ:

- CourierNew,

, 16, .

Transparentқ ң True қ.

 

5.Timer1 . ө ү, var ө .

unit Project2; interface uses

 

Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;

type

TForm1 = class(TForm) Timer1: TTimer; Shape1: TShape; Shape2: TShape; Label1: TLabel;

procedure Timer1Timer(Sender: TObject); procedure FormCreate(Sender: TObject); private

{ Private declarations } public

{ Public declarations } end;

var

Form1: TForm1; x:real; implementation {$R *.DFM}

procedure TForm1.Timer1Timer(Sender: TObject); begin

x:= x+0.1;

 


Shape2.Left:=265+trunc(150*cos(x));

Shape2.Top:=150-trunc(150*sin(x)) end;

procedure TForm1.FormCreate(Sender: TObject); begin

end; initialization x:=0

end.

6. File/ Save All , ә Project2 қ, Unit2 қ. F9 қ ғ .

 

 

қ ұ 7

 

RadioGroup, CheckListBox құ

 

Edit ғ ғ қ, ң қ құ.

1. File/New/Application қ ң қ .

 

2. Form1 ғ CheckListBox1 , Additional , қғ Standard ң . ң RadioGroup, CheckListBox, Label ә Edit.

 

3. Caption қң RadioGroup1, RadioGroup2 ә RadioGroup3

 

, ә ә қ.

4. Items қ ғ ө ү ү . ғ StringListeditor қғ .

RadioGroup1 ө :

 

 

 

 


 

 

RadioGroup2 :

   
   
   
  RadioGroup3 :

 

 

ң ғ .

5. қ қ ғ ү ItemIndexқ ң 0 қ. ,

.
6. Label1 ә Label2 Captionқ ә
қ.      

6. CheckListBox1 Itemsқ ң ә қ ң. :

7. Edit1 Textқ ң қ: .

8. RadioGroup1 . ғ OnClick қғ өң ң:

 


case RadioGroup1.ItemIndex of

0: Edit1.Font.Style:=[];

1: Edit1.Font.Style:=[fsItalic];

2: Edit1.Font.Style:=[fsBold];

3: Edit1.Font.Style:=[fsItalic,fsBold];

end;

CheckListBox1ClickCheck(Self);

9. RadioGroup2 ң OnClick: case RadioGroup2.ItemIndex of

 

0: Edit1.Font.Size:=8;

1: Edit1.Font.Size:=10;

2: Edit1.Font.Size:=12;

3: Edit1.Font.Size:=14; end

10. RadioGroup3 OnClick қғң

ң:

case RadioGroup3.ItemIndex of

0: Edit1.Font.Color:=clBlack;

1: Edit1.Font.Color:=clGreen;

2: Edit1.Font.Color:=clRed;

3: Edit1.Font.Color:=clBlue; end

11. CheckListBox1 OnClickCheck, қғ :

if CheckListBox1.Checked[0]

then Edit1.Font.Style:=Edit1.Font.Style+[fsStrikeOut] else Edit1.Font.Style:=Edit1.Font.Style-[fsStrikeOut]; if CheckListBox1.Checked[1]

then Edit1.Font.Style:=Edit1.Font.Style+[fsUnderline] else Edit1.Font.Style:=Edit1.Font.Style-[fsUnderline];

12. File/Save All . Run/Run қ қ ғ .

 

 

ң қң қ ө.

 


unit RadioGroup; interface

 

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, CheckLst;

type

TForm1 = class(TForm) RadioGroup1: TRadioGroup; RadioGroup2: TRadioGroup; RadioGroup3: TRadioGroup; CheckListBox1: TCheckListBox; Edit1: TEdit;

Label1: TLabel;

Label2: TLabel;

procedure RadioGroup1Click(Sender: TObject); procedure RadioGroup2Click(Sender: TObject); procedure RadioGroup3Click(Sender: TObject); procedure CheckListBox1ClickCheck(Sender: TObject); private

{ Private declarations } public

{ Public declarations } end;

 

var

Form1: TForm1;

 

implementation

 

{$R *.DFM}

procedure TForm1.RadioGroup1Click(Sender:TObject); begin

case RadioGroup1.ItemIndex of

0: Edit1.Font.Style:=[];

1: Edit1.Font.Style:=[fsItalic];

2: Edit1.Font.Style:=[fsBold];

3: Edit1.Font.Style:=[fsItalic,fsBold];

end;

CheckListBox1ClickCheck(Self);

end;

 

procedure TForm1.RadioGroup2Click(Sender:TObject); begin

case RadioGroup2.ItemIndex of

0: Edit1.Font.Size:=8;

1: Edit1.Font.Size:=10;

2: Edit1.Font.Size:=12;

3: Edit1.Font.Size:=14; end

end;

 


procedure TForm1.RadioGroup3Click(Sender:TObject); begin

case RadioGroup3.ItemIndex of

0: Edit1.Font.Color:=clBlack;

1: Edit1.Font.Color:=clGreen;

2: Edit1.Font.Color:=clRed;

3: Edit1.Font.Color:=clBlue; end

end;

 

procedure TForm1.CheckListBox1ClickCheck(Sender:TObject); begin

if CheckListBox1.Checked[0]

then Edit1.Font.Style:=Edit1.Font.Style+[fsStrikeOut] else Edit1.Font.Style:=Edit1.Font.Style-[fsStrikeOut]; if CheckListBox1.Checked[1]

then Edit1.Font.Style:=Edit1.Font.Style+[fsUnderline] else Edit1.Font.Style:=Edit1.Font.Style-[fsUnderline]; end;

 

end.

 





:


: 2017-01-28; !; : 741 |


:

:

,
==> ...

1584 - | 1345 -


© 2015-2024 lektsii.org - -

: 0.017 .