procedure TForm1.btn1Click(Sender: TObject); begin If Img1.Visible then Begin btn1.Caption:='Моє місто'; Img1.Visible:=False; Img2.Visible:=True; End Else If Img2.Visible Then Begin btn1.Caption:='Портретна фотографія'; btn2.Enabled:=True; btn2.Visible:=True; Img2.Visible:=False; Img3.Visible:=True; End Else Begin btn1.Caption:='Художня фотографія'; btn2.Enabled:=True; btn2.Visible:=True; Img3.Visible:=False; Img1.Visible:=True; End; end; This is the program code, in which when the button is pressed, the pictures change.
It is necessary to make sure that the name of the image that is currently visible is displayed in the label .