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 .

    1 answer 1

    And where are the pictures loaded from or are they already uploaded? Well, as an option after each Begin to write

     Label1.caption:='Картинка така ето'; 

    But as I understand it, you don’t need this option, for a more detailed answer it’s advisable to see the full code.

    • I load pictures from my computer, not standard ones. - Taras
    • What kind of pictures? var Img1: what is there? And where to get them, through ShowMessage or something? Damn, "I need to bring some inscription somewhere, how?" - Sh4dow pm
    • one
      By and large, the code is all curve. It would be clear the task could be written, a more nice looking working code. And why use 3 IMAGE if only one is shown at a time. - SoftR