くだすれDelphi(超初心者)その27
■ このスレッドは過去ログ倉庫に格納されています
0076デフォルトの名無しさん
2005/09/17(土) 18:54:21ヘルプより
type
TFontStyle = (fsBold, fsItalic, fsUnderline, fsStrikeOut);
TFontStyles = set of TFontStyle;
要素が最大5つしかない集合型は byte と互換
保存は byte として数値で。復帰は TFontStyles にキャストするだけ。
こんな感じ
var
fontstyles: byte;
procedure TForm1.Button1Click(Sender: TObject);
begin
Button1.Font.Style := [fsBold, fsUnderline];
fontstyles := byte(Button1.Font.Style);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Button2.Font.Style := TFontStyles(fontstyles);
end;
■ このスレッドは過去ログ倉庫に格納されています