commit
dac23b6c27
6 changed files with 1248 additions and 0 deletions
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,35 @@ |
|||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#include <vcl.h> |
||||||
|
#pragma hdrstop |
||||||
|
#include <tchar.h> |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
USEFORM("Unit1.cpp", Form1); |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int) |
||||||
|
{ |
||||||
|
try |
||||||
|
{ |
||||||
|
Application->Initialize(); |
||||||
|
Application->MainFormOnTaskBar = true; |
||||||
|
Application->CreateForm(__classid(TForm1), &Form1); |
||||||
|
Application->Run(); |
||||||
|
} |
||||||
|
catch (Exception &exception) |
||||||
|
{ |
||||||
|
Application->ShowException(&exception); |
||||||
|
} |
||||||
|
catch (...) |
||||||
|
{ |
||||||
|
try |
||||||
|
{ |
||||||
|
throw Exception(""); |
||||||
|
} |
||||||
|
catch (Exception &exception) |
||||||
|
{ |
||||||
|
Application->ShowException(&exception); |
||||||
|
} |
||||||
|
} |
||||||
|
return 0; |
||||||
|
} |
||||||
|
//---------------------------------------------------------------------------
|
@ -0,0 +1,3 @@ |
|||||||
|
#include <vcl.h> |
||||||
|
#include <tchar.h> |
||||||
|
|
@ -0,0 +1,31 @@ |
|||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#include <vcl.h> |
||||||
|
#pragma hdrstop |
||||||
|
|
||||||
|
#include "Unit1.h" |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
#pragma package(smart_init) |
||||||
|
#pragma resource "*.dfm" |
||||||
|
TForm1 *Form1; |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
__fastcall TForm1::TForm1(TComponent* Owner) |
||||||
|
: TForm(Owner) |
||||||
|
{ |
||||||
|
} |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
void __fastcall TForm1::Button1Click(TObject *Sender) |
||||||
|
{ |
||||||
|
int upper; |
||||||
|
int i; |
||||||
|
int sum=0; |
||||||
|
|
||||||
|
upper = StrToInt(Edit1->Text); |
||||||
|
|
||||||
|
for( i= 1 ; i <= upper ; i++ ) |
||||||
|
sum += i; |
||||||
|
Label3->Caption = IntToStr(sum); |
||||||
|
|
||||||
|
} |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
@ -0,0 +1,82 @@ |
|||||||
|
object Form1: TForm1 |
||||||
|
Left = 0 |
||||||
|
Top = 0 |
||||||
|
Caption = 'Form1' |
||||||
|
ClientHeight = 154 |
||||||
|
ClientWidth = 376 |
||||||
|
Color = clBtnFace |
||||||
|
Font.Charset = DEFAULT_CHARSET |
||||||
|
Font.Color = clWindowText |
||||||
|
Font.Height = -11 |
||||||
|
Font.Name = 'Tahoma' |
||||||
|
Font.Style = [] |
||||||
|
TextHeight = 13 |
||||||
|
object Label1: TLabel |
||||||
|
Left = 30 |
||||||
|
Top = 31 |
||||||
|
Width = 39 |
||||||
|
Height = 23 |
||||||
|
Caption = '1'#12363#12425 |
||||||
|
Font.Charset = DEFAULT_CHARSET |
||||||
|
Font.Color = clWindowText |
||||||
|
Font.Height = -19 |
||||||
|
Font.Name = 'Tahoma' |
||||||
|
Font.Style = [] |
||||||
|
ParentFont = False |
||||||
|
end |
||||||
|
object Label2: TLabel |
||||||
|
Left = 188 |
||||||
|
Top = 31 |
||||||
|
Width = 30 |
||||||
|
Height = 23 |
||||||
|
Caption = #12414#12391 |
||||||
|
Font.Charset = DEFAULT_CHARSET |
||||||
|
Font.Color = clWindowText |
||||||
|
Font.Height = -19 |
||||||
|
Font.Name = 'Tahoma' |
||||||
|
Font.Style = [] |
||||||
|
ParentFont = False |
||||||
|
end |
||||||
|
object Label3: TLabel |
||||||
|
Left = 78 |
||||||
|
Top = 96 |
||||||
|
Width = 27 |
||||||
|
Height = 23 |
||||||
|
Caption = '???' |
||||||
|
Font.Charset = DEFAULT_CHARSET |
||||||
|
Font.Color = clWindowText |
||||||
|
Font.Height = -19 |
||||||
|
Font.Name = 'Tahoma' |
||||||
|
Font.Style = [] |
||||||
|
ParentFont = False |
||||||
|
end |
||||||
|
object Button1: TButton |
||||||
|
Left = 236 |
||||||
|
Top = 30 |
||||||
|
Width = 113 |
||||||
|
Height = 28 |
||||||
|
Caption = #21644#12398#35336#31639 |
||||||
|
Font.Charset = DEFAULT_CHARSET |
||||||
|
Font.Color = clWindowText |
||||||
|
Font.Height = -19 |
||||||
|
Font.Name = 'Tahoma' |
||||||
|
Font.Style = [] |
||||||
|
ParentFont = False |
||||||
|
TabOrder = 0 |
||||||
|
OnClick = Button1Click |
||||||
|
end |
||||||
|
object Edit1: TEdit |
||||||
|
Left = 78 |
||||||
|
Top = 28 |
||||||
|
Width = 91 |
||||||
|
Height = 31 |
||||||
|
Font.Charset = DEFAULT_CHARSET |
||||||
|
Font.Color = clWindowText |
||||||
|
Font.Height = -19 |
||||||
|
Font.Name = 'Tahoma' |
||||||
|
Font.Style = [] |
||||||
|
ParentFont = False |
||||||
|
TabOrder = 1 |
||||||
|
Text = '10' |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,27 @@ |
|||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifndef Unit1H |
||||||
|
#define Unit1H |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
#include <System.Classes.hpp> |
||||||
|
#include <Vcl.Controls.hpp> |
||||||
|
#include <Vcl.StdCtrls.hpp> |
||||||
|
#include <Vcl.Forms.hpp> |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
class TForm1 : public TForm |
||||||
|
{ |
||||||
|
__published: // IDE で管理されるコンポーネント
|
||||||
|
TButton *Button1; |
||||||
|
TEdit *Edit1; |
||||||
|
TLabel *Label1; |
||||||
|
TLabel *Label2; |
||||||
|
TLabel *Label3; |
||||||
|
void __fastcall Button1Click(TObject *Sender); |
||||||
|
private: // ユーザー宣言
|
||||||
|
public: // ユーザー宣言
|
||||||
|
__fastcall TForm1(TComponent* Owner); |
||||||
|
}; |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
extern PACKAGE TForm1 *Form1; |
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
#endif |
Loading…
Reference in new issue