互動式輸入與選擇元件全方位應用指南
1.3.1.3 組合框初始化常用模式
procedure TForm1.ComboBox1Text(Sender: TObject);
begin
if ComboBox1.Text = '' then
ComboBox1.Text := ComboBox1.Items.Strings[1]; // 以第一項為預設值
end;
1.3.2 按鈕與核取方塊元件
1.3.2.1 Button 與 BitBtn
- 常用於對話框執行特定功能
ModalResult 內建返回值:設定匹配值可無程式碼實現系統內建功能(如 mrOk、mrCancel)
Kind 屬性類似,預設行為與圖示綁定
1.3.2.2 SpeedButton (Additional)
- 工具列快速設計理想元件:僅有位圖、無標題
- 關鍵限制:多個 SpeedButton 製作工具列時,必須先放置容器元件(Panel、GroupBox 等),再將 SpeedButton 放入容器內
- 否則 SpeedButton 會置於容器下層不可見
- 替代方案:複製/貼上至容器元件上
1.3.2.3 CheckBox 與 RadioButton