Home > Software engineering >  Pray god help, VB6.0 by use making slides player out a little situation
Pray god help, VB6.0 by use making slides player out a little situation

Time:09-25

Don't touch the VB6.0 by use for a long time, a little technical problems, needs a great god help,
Online to find an article on programming "VB production slide player"
Address: http://www.doc88.com/p-9394448228185.html
Appeared in the process of running "compiler error, the variable is undefined", as the chart,

Ask how to modify the code, says it is not defined file1.




Interface is as follows:


The complete code is as follows:

Option Explicit
Dim the Message, the Title, the Default, MyValue
Dim Pi
Dim As Integer I


Private Sub Image3_Click ()
End
End Sub

Private Sub Image4_Click ()
Image2. Visible=False
If Pi=0 Then
MsgBox (" welcome!" )
The Else
Pi Pi=1
End the If
Image1. Stretch=False
Image1. Visible=False
Image1. Picture=LoadPicture (App) Path + "" + File1) List (Pi))
If Image1. Height & gt; Form1. Height Then
Image1. Width=Image1. Width * Form1. Height/Image1. Height
Image1. Height=Form1. Height
Image1. Stretch=True
Image1. Move (Form1. Width - Image1. Width)/2, 0
The Else
Image1. Move (Form1. Width - Image1. Width)/2, (Form1. Height - Image1. Height)/2
End the If
Image1. Visible=True
End Sub

Private Sub Form_Click ()
Image2. Visible=False
Then the If Pi=File1. ListCount - 1
MsgBox (" thank you for watching!" )
The Else
Pi Pi + 1=
End the If
Image1. Stretch=False
Image1. Visible=False
Image1. Picture=LoadPicture (App) Path + "" + File1) List (Pi))
If Image1. Height & gt; Form1. Height Then
Image1. Width=Image1. Width * Form1. Height/Image1. Height
Image1. Height=Form1. Height
Image1. Stretch=True
Image1. Move (Form1. Width - Image1. Width)/2, 0
The Else
Image1. Move (Form1. Width - Image1. Width)/2, (Form1. Height - Image1. Height)/2
End the If
Image1. Visible=True
End Sub

Private Sub Form_Load ()
Form1. Move 0, 0, Screen Width, Screen. Height
File1. Path=App. Path
File1. The Pattern=(*. BMP;" * JPG. * GIF ")
Image2. Visible=False
Image1. Stretch=False
Image1. Visible=False
Image1. Picture=LoadPicture (App) Path + "" + File1) List (0))
If Image1. Height & gt; Form1. Height Then
Image1. Width=Image1. Width * Form1. Height/Image1. Height
Image1. Height=Form1. Height
Image1. Stretch=True
Image1. Move (Form1. Width - Image1. Width)/2, 0
The Else
Image1. Move (Form1. Width - Image1. Width)/2, (Form1. Height - Image1. Height)/2
End the If
Text1. Visible=False
Image1. Visible=True
Image3. Move (Form1. Width - Image3. Width), (Form1. Height - Image4. Height * 2)
Image4. Move (Form1. Width - Image3. Width), (Form1. Height - Image4. Height)
Text1. Move (Form1. Width - Text1. Width)/2, (Form1. Height - Text1. Height * 2)
End Sub

Private Sub Form_MouseMove (Button As an Integer, shift the As an Integer, As Single X, Y As Single)
Text1. Visible=False
End Sub

Private Sub Image1_MouseMove (Button As an Integer, shift the As an Integer, As Single X, Y As Single)
Text1. Visible=True
Text1. Text=File1. List (Pi)
End Sub


Private Sub Image1_Click ()
Dim Msg, Style, Title, help, Ctxt, Response, mystring
Image2. Visible=False
Then the If Pi=File1. ListCount - 1
Msg="thanks for watching!"
Style=vbYesNo + vbDefaultButton2
Title="play!"
Help="DEMO. HLP
"Ctxt=1000
The Response=MsgBox (Mag, Style, Title, help, Ctxt)
If the Response=vbYes Then
Mystring="Yes"
End
The Else
Mystring="No"
End the If
The Else
Pi Pi + 1=
End the If
Image1. Stretch=False
Image1. Visible=False
Image1. Picture=LoadPicture (App) Path + "" + File1) List (Pi))
If Image1. Height & gt; Form1. Height Then
Image1. Width=Image1. Width * Form1. Height/Image1. Height
Image1. Height=Form1. Height
Image1. Stretch=True
Image1. Move (Form1. Width - Image1. Width)/2, 0
The Else
Image1. Move (Form1. Width - Image1. Width)/2, (Form1. Height - Image1. Height)/2
End the If
Image1. Visible=True
End Sub

CodePudding user response:

Preliminary observation should be the file control, drag a to form...

CodePudding user response:

reference 1st floor Topc008 response:
preliminary observation should be the file control, drag a to form...

It should be this reason,

CodePudding user response:

A list control, continue to debug, real-time error "76".
My project is saved in the disk C VB Form under the folder,
Is program reference path, the absolute path and the relative path problem, how to change?






CodePudding user response:

Give you said is " "File control, you drag a List controls,
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related