PDA

View Full Version : [SOLVED:] Change picture depending on choice



petroj02
08-03-2016, 04:43 AM
Hello everyone,
In myform I have few Option Buttons and one Image. Depending on Chosen button I would like to Change Picture file for Image. But I dont know the right Syntax for calling needed Picture file, or I dont know if it is even possible.
Here is short sketch for better understanding the Problem:

If OptionButton1.Value = True Then
image1.Picture= First Picture I want to Show
else if OptionButton2.Value = True Then
image1.Picture= Second Picture I want to Show
End If
I would be really glad if anyone could help me....

GTO
08-03-2016, 04:57 AM
Try LoadPicture:


Me.Image1.Picture = LoadPicture("C:\MyPictures\horses.jpg")

petroj02
08-03-2016, 05:07 AM
This is the correct Syntax.
I highly appreciate your fast help. Thank you

GTO
08-03-2016, 06:01 AM
You are most welcome and thank you for the feedback.