Показать сообщение отдельно
  #1  
Старый 25.09.2018, 16:25
Alex7 Alex7 вне форума
Новичок
 
Регистрация: 18.09.2018
Сообщения: 62
Версия Delphi: Delphi 7
Репутация: 10
По умолчанию Edit зависит от SpeedButton

Здравствуйте, накидал код:
Код:
procedure TForm1.SpeedButton3MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
ilBtnState.GetBitmap(1, SpeedButton3.Glyph);
if ilBtnState.GetBitmap(1, SpeedButton3.Glyph) then Edit1.Text := FloatToStr(10);
end;
 
procedure TForm1.SpeedButton3MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ilBtnState.GetBitmap(0, SpeedButton3.Glyph);
 
if ilBtnState.GetBitmap(1, SpeedButton3.Glyph) then Edit1.Text := FloatToStr(10);
if ilBtnState.GetBitmap(0, SpeedButton3.Glyph) then Edit1.Text := FloatToStr(0);
end;
Нужно чтобы значение edit менялось в зависимости от кнопки SpeedButton, в нажатом состоянии =10, в ненажатом =0
И всё бы хорошо, кнопка фиксируется вкл/выкл, картинка на кнопке меняется, а вот значение edit перескакивает с 10 на 0 когда отпускаю мышку, как победить?
Ответить с цитированием