Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.153 Beiträge
 
Delphi 12 Athens
 
#6

AW: Edit1 und Edit2 proportional ändern

  Alt 11. Apr 2011, 16:25
Zitat:
Delphi-Quellcode:
if ((CheckBox1.Checked)and (edit1.Focused) ) or
   ((CheckBox1.Checked) and (UpDown1.Focused)) then
Warum es aber zweimal drin ist, ist nicht klar.
if CheckBox1.Checked and (edit1.Focused or UpDown1.Focused) then .

Und warum die lokalen Variablen (NeueBreite, AlteBreite, AlteHoehe) global deklariert sind, auch nicht.

Delphi-Quellcode:
procedure TForm1.Edit1Change(Sender: TObject);
begin
  if CheckBox1.Checked and (Sender = Edit1) then
    Edit2.Text := IntToStr(Round(StrToInt(Edit1.Text) * Image1.Height / Image1.Width));
  if CheckBox1.Checked and (Sender = Edit2) then
    Edit1.Text := IntToStr(Round(StrToInt(Edit2.Text) * Image1.Width / Image1.Height));
end;
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat