![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
bold button
lauren © (2005-09-13 01:37:00)ну зделала bold button. нажымаю становится жырным,но не знаю как зделать так чтоб очередном шелчке произошло обраное. может кто нибуть поможет?
Наиль (2005-09-13 08:49:00) [1]function ReverseBoldStyle (FontStyle: TFontStyles): TFontStyles;
begin
Result := FontStyle+fsBold-fsBold*FontStyle;
end;
Джо (2005-09-13 01:51:00) [2]
> [1] Цукор 5 (13.09.05 01:45)
Все же, наверное, корректнее будет так:
procedure TForm1.Button1Click(Sender: TObject);
function ReverseBoldStyle (FontStyle: TFontStyles): TFontStyles;
begin
Result := FontStyle;
if fsBold in FontStyle then
Exclude (Result,fsBold)
else
Include (Result,fsBold)
end;
begin
Button1.Font.Style := ReverseBoldStyle(Button1.Font.Style)
end;
Цукор 5 (2005-09-13 01:45:00) [3]
begin
if Button1.Font.Style = [fsBold]
then
Button1.Font.Style:=[]
else
Button1.Font.Style:=[fsBold];
end;