Home > Software engineering >  Don't know where is wrong don't tangle that vb program CreateObject (" wmplayer. Ocx
Don't know where is wrong don't tangle that vb program CreateObject (" wmplayer. Ocx

Time:10-07

 Option Explicit 
The Public As an Integer I
Dim a, b

Private Sub Command1_Click ()
Dim x As Integer
X=MsgBox (" are you sure save?" , vbDefaultButton1 vbYesNo + + vbQuestion, "hint") 'msgbox calls, create the form
If x=6 Then
Dim strFileName As String 'file name
Dim lngHandle As Long handle
'Dim strWrite As String
'to write the text content of
StrFileName=". TXT "
LngHandle=FreeFile ()
'get handle
'ready to write the contents of the
StrWrite=I
'For the back of the parameter and how to open the file, the Input is read, the Output is covered, Append is additional written
The Open strFileName For Output As lngHandle
'opens the file
Print # lngHandle strWrite
Write text
'The Close lngHandle
'close the file
A.C ontrols. Stop
A.C lose
Set a=Nothing
End
End the If
End Sub



Private Sub Picture3_Click ()
Dim strFileName As String
'the name of the file
Dim lngHandle As Long
'file handle
Dim strAll As String
'read by all of the text file content
Dim strLine As String
'in a loop for each line of content
StrFileName=". TXT "
'get file handle
LngHandle=FreeFile ()
'For the back of the parameter and how to open the file, the Input is read, the Output is covered, Append is additional written
The Open strFileName For Input As lngHandle
'the cycle until the end-of-file
The Do While Not EOF (lngHandle)
'every time read a line in strLine variable
The Line Input # lngHandle strLine
'every time I read the read the contents of the connection to the strAll variables, due to the Line Input to remove the newline character, so this up here
StrAll=strAll & amp; StrLine & amp; VbCrLf
Loop
'according to get the whole part of
I=strAll
Image1. Picture=LoadPicture (App) Path & amp; "\ \ images background 1. JPG")
Picture3. Visible=False
Picture4. Visible=True
Command1. Visible=True
Picture4. Picture=LoadPicture (App) Path & amp; "\ '" & amp; I & amp; ". JPG ")
If strAll & gt;=7 & amp; StrAll & lt; 14 Then
Image1. Picture=LoadPicture (App) Path & amp; "Outside \ \ images background 1. JPG")
The Else
If strAll & gt;=14 & amp; StrAll & lt; Then 200
Image1. Picture=LoadPicture (App) Path & amp; "Outside \ \ images background 2. JPG")
End the If
End the If
End Sub
Private Sub Form_Load ()
Set a=CreateObject (" wmplayer. Ocx ")
The Set b=CreateObject (" wmplayer. Ocx ")
A.u rl=App. Path & amp; "Initial music/music/mp3."
A.s ettings. PlayCount=99999
End Sub
Private Sub Form_Unload (Cancel As Integer)
Biggest ontrols. Stop
The biggest lose
The Set b=Nothing
A.C ontrols. Stop
A.C lose
Set a=Nothing
End Sub

Private Sub Image2_Click ()
I=7
Image2. Visible=False
Image3. Visible=False
Image4. Visible=False
Picture4. Visible=True
Image1. Picture=LoadPicture (App) Path & amp; "\ \ images background 1. JPG")
Picture4. Picture=LoadPicture (App) Path & amp; "\ \ images 7. JPG")
Image1. Picture=LoadPicture (App) Path & amp; "Outside \ \ images background 1. JPG")
End Sub

Private Sub Image3_Click ()
I=100
Image2. Visible=False
Image3. Visible=False
Image4. Visible=False
Picture4. Visible=True
Image1. Picture=LoadPicture (App) Path & amp; "\ \ images background 1. JPG")
Picture4. Picture=LoadPicture (App) Path & amp; "\ \ images 7. JPG")
End Sub


 Private Sub Picture1_Click () 
Image1. Picture=LoadPicture (App) Path & amp; "\ \ IMAGES background 1. JPG")
Picture4. Visible=True
Picture4. Picture=LoadPicture (App) Path & amp; \ \ "images z.j pg")
Picture1. Visible=False
Picture2. Visible=False
Command1. Visible=True
Picture5. Visible=False
A.C ontrols. Stop
A.C lose
Set a=Nothing
Set a=CreateObject (" wmplayer. Ocx ")
The Set b=CreateObject (" wmplayer. Ocx ")
B.u rl=App. Path & amp; "Music/music/change. Mp3"
B.s ettings. PlayCount=99999
End Sub

Private Sub Picture2_Click ()
Picture1. Visible=False
Picture2. Visible=False
Image1. Picture=LoadPicture (App) Path & amp; "\ \ images read background. JPG")
Picture3. Visible=True
Picture5. Visible=False
End Sub

Private Sub Picture5_Click ()
Dim MSG As Integer
MSG=MsgBox (" are you sure you want to quit?" , vbDefaultButton1 vbYesNo + + vbQuestion, "hint") 'msgbox function to open a form
If the MSG=6 Then
A.C ontrols. Stop
A.C lose
Set a=Nothing
End
End the If
End Sub

Private Sub Picture4_Click ()
Picture4. Picture=LoadPicture (App) Path & amp; "\ '" & amp; I & amp; ". JPG ")
I=I + 1
If I=6 Then
Image2. Visible=True
Image3. Visible=True
Image4. Visible=True
Image1. Picture=LoadPicture (App) Path & amp; "\ \ images background 2. JPG")
Picture4. Visible=False
Image2. Picture=LoadPicture (App) Path & amp; "\ \ images x1. JPG")
Image3. Picture=LoadPicture (App) Path & amp; "\ \ images x2. JPG")
Image4. Picture=LoadPicture (App) Path & amp; \ \ "images x3. JPG")
End the If
If I=14 Then
Image1. Picture=LoadPicture (App) Path & amp; "Outside \ \ images background 2. JPG")
If I=21 Then
Image1. Picture=LoadPicture (App) Path & amp; "Outside \ \ images background 1. JPG")
If I=21 Then
Image1. Picture=LoadPicture (App) Path & amp; "\ \ images background 1. JPG")
If I=25 Then
Image2. Visible=True
Image3. Visible=True
Image4. Visible=True
Picture4. Visible=False
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related