Difference between revisions of "TGroupBox/ja"
From Free Pascal wiki
Jump to navigationJump to searchLine 3: | Line 3: | ||
{{ Japanese Menu }} | {{ Japanese Menu }} | ||
− | + | '''TGroupBox'''は、[[image:tgroupbox.png]]フォーム上で物理的および概念的に複数のオブジェクトをグループ化するためのコンテナである。GroupBox内のコントロールは、関連する機能や情報をグループ化して表示するのに役立つ。 | |
− | == | + | ==使い方== |
− | + | フォーム上で[[doc:lcl/stdctrls/tgroupbox.html|TGroupBox]]を使用するには、単に[[Component Palette/ja|コンポーネントパレット]]の[[Standard tab/ja|Standardタブ]]からそれを選択し、フォーム上でクリックして配置する。GroupBoxは、関連するコントロールや情報を視覚的にグループ化するための便利なコンテナである。 | |
− | == | + | ==例== |
* create a new application and place two TGroupBoxes on your form | * create a new application and place two TGroupBoxes on your form | ||
* in GroupBox1 insert a [[TButton]] ''Button1'' and in GroupBox2 TButton ''Button2'' | * in GroupBox1 insert a [[TButton]] ''Button1'' and in GroupBox2 TButton ''Button2'' |
Revision as of 08:10, 24 March 2024
│
Deutsch (de) │
English (en) │
suomi (fi) │
français (fr) │
日本語 (ja) │
русский (ru) │
TGroupBoxは、フォーム上で物理的および概念的に複数のオブジェクトをグループ化するためのコンテナである。GroupBox内のコントロールは、関連する機能や情報をグループ化して表示するのに役立つ。
使い方
フォーム上でTGroupBoxを使用するには、単にコンポーネントパレットのStandardタブからそれを選択し、フォーム上でクリックして配置する。GroupBoxは、関連するコントロールや情報を視覚的にグループ化するための便利なコンテナである。
例
- create a new application and place two TGroupBoxes on your form
- in GroupBox1 insert a TButton Button1 and in GroupBox2 TButton Button2
- put on your form (outside of the groupboxes) two TRadioButton
- change in the object Inspector the caption of RadioButton1 to User and of RadioButton2 to Administrator
- change the property Checked of RadioButton2 to True
- create the OnChange event handler of RadioButton1 by double clicking RadioButton1
- use this handler also for RadioButton2
- choose in the object Inspector RadioButton2'
- now select the tab Events in the object Inspector
- go to the event OnChange and select in the adjacent combobox RadioButton1Change
- make GroupBox2 for user invisible by choosing in the RadioButton
- write following line in the event handler of the RadioButtons in the source editor:
procedure TForm1.RadioButton1Change(Sender: TObject);
begin
GroupBox2.Visible:=Radiobutton2.Checked;
end;
- add still the event handler of the buttons and add some code like:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage('User and administrator can click this button');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShowMessage('Only administrator can click this button');
end;
- it shows in the ShowMessage dialog who can press the button
- start your program, it could look like:
See also