TGroupBox/ja: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: TGroupBox/ja
| Old | New | Line | |
|---|---|---|---|
| 1 | + | **TGroupBox**は、フォーム上で物理的および概念的に複数のオブジェクトをグループ化するためのコンテナである。GroupBox内のコントロールは、関連する機能や情報をグループ化して表示するのに役立つ。 | |
| 2 | + | ||
| 3 | + | ## 使い方 | |
| 4 | + | ||
| 5 | + | フォーム上で[[doc:lcl/stdctrls/tgroupbox.html|TGroupBoxを]]使用するには、単に[[Component Palette/ja|コンポーネントパレットの]][[Standard tab/ja|Standardタブからそれを]]選択し、フォーム上でクリックして配置する。GroupBoxは、関連するコントロールや情報を視覚的にグループ化するための便利なコンテナである。 | |
| 6 | + | ||
| 7 | + | ## 例 | |
| 8 | + | ||
| 9 | + | - 新しいアプリケーションを作成し、フォームに2つのTGroupBoxを配置 | |
| 10 | + | - GroupBox1には[[TButton/ja]]、*Button1*を、GroupBox2にはTButton、*Button2*を配置する。 | |
| 11 | + | - フォームの外側に[[TRadioButton/ja|TRadioButton/jaを]]2つ配置する。 | |
| 12 | + | - [[IDE Window: Object Inspector/ja|オブジェクトインスペクタで]]、RadioButton1のCaptionを*User*に、RadioButton2のCaptionを*Administrator*に変更する。 | |
| 13 | + | - RadioButton2のChecked[[Property/ja|propertyを]]*[[True]]*に設定する。 | |
| 14 | + | - RadioButton1をダブルクリックして、RadioButton1の*OnChange*[[Event handler|イベントハンドラ]]''を作成する。 | |
| 15 | + | - このハンドラをRadioButton2のOnChangeイベントにも割り当てる。 | |
| 16 | + | - オブジェクトインスペクタで、*RadioButton2*を選択する。 | |
| 17 | + | - オブジェクトインスペクタに移動し*Events* を選択する。 | |
| 18 | + | - OnChangeイベントを選択し、隣接するコンボボックスで*RadioButton1Change*を選択する。 | |
| 19 | + | - ラジオボタンのイベントハンドラで、*GroupBox2*をユーザーから非表示にする。 | |
| 20 | + | - ソースエディタのRadioButtonのイベントハンドラに以下の行を記述する: | |
| 21 | + | ||
| 22 | + | ``` Pascal | |
| 23 | + | procedure TForm1.RadioButton1Change(Sender: TObject); | |
| 24 | + | begin | |
| 25 | + | GroupBox2.Visible:=Radiobutton2.Checked; | |
| 26 | + | end; | |
| 27 | + | ``` | |
| 28 | + | ||
| 29 | + | ボタンのイベントハンドラも追加し、以下のようなコードを追加する: | |
| 30 | + | ||
| 31 | + | ``` Pascal | |
| 32 | + | procedure TForm1.Button1Click(Sender: TObject); | |
| 33 | + | begin | |
| 34 | + | ShowMessage('User and administrator can click this button'); | |
| 35 | + | end; | |
| 36 | + | procedure TForm1.Button2Click(Sender: TObject); | |
| 37 | + | begin | |
| 38 | + | ShowMessage('Only administrator can click this button'); | |
| 39 | + | end; | |
| 40 | + | ``` | |
| 41 | + | ||
| 42 | + | - ボタンを押せる人を示す[[Dialog Examples|ShowMessageダイアログに]]表示される。 | |
| 43 | + | - 実行すると以下のように見える: | |
| 44 | + | ||
| 45 | + |  -\>  | |
| 46 | + | ||
| 47 | + | ## See also | |
| 48 | + | ||
| 49 | + | - [[doc:lcl/stdctrls/tgroupbox.html|TGroupBox doc]] | |
| 50 | + | - [[TPairSplitter]] | |
| 51 | + | - [[TNotebook]] | |
| 52 | + | - [[TPageControl]] | |
| 53 | + | - [[TTabControl]] | |
| 54 | + | ||
| 55 | + | --- | |
| 56 | + | *From the Free Pascal wiki, page "TGroupBox/ja", as it stood on 2024-03-24 after a change by Ariben, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
