ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User Form (https://www.excelbanter.com/excel-programming/310569-user-form.html)

tim

User Form
 
Hello All,

I am trying to create a help form with "Next"
and "Previous" buttons. My form consists of 12 separate
images. I will use a list box to move through the images
(I think I can handle that part). I have the
userForm "activate" hiding all my images except the title
when opened. I need to identify the image that is
visible when the "Next" or "Previous" is clicked so I can
cycle to the next. My images are named img1, img2, etc.

Thanks in advance

Harald Staff

User Form
 
Hi

Declare a variable outside the subs for that. Replace the Msgbox'es with
something useful:

Dim Limage As Long

Private Sub CommandButton1_Click()
If Limage 1 Then Limage = Limage - 1
MsgBox Limage
End Sub

Private Sub CommandButton2_Click()
If Limage < 12 Then Limage = Limage + 1
MsgBox Limage
End Sub

HTH. Best wishes Harald

"Tim" skrev i melding
...
Hello All,

I am trying to create a help form with "Next"
and "Previous" buttons. My form consists of 12 separate
images. I will use a list box to move through the images
(I think I can handle that part). I have the
userForm "activate" hiding all my images except the title
when opened. I need to identify the image that is
visible when the "Next" or "Previous" is clicked so I can
cycle to the next. My images are named img1, img2, etc.

Thanks in advance





All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com