Sep 6th, 2004, 11:55 PM
#1
Thread Starter
Fanatic Member
hourglass gif ? anyone ?
Guys,
Does anyone has hourglass gif animated? i need to make it animate when the program is loading.... please help where can i find it.. ?
and what is the best way to animate in VB ?
Sep 7th, 2004, 12:11 AM
#2
Attached Files
Sep 7th, 2004, 12:15 AM
#3
and this is how we play animated cursors
VB Code:
' This code to be inserted into a module
Private Declare Function LoadCursorFromFile Lib "user32" Alias _
"LoadCursorFromFileA" (ByVal lpFileName As String) As Long
Private Declare Function SetSystemCursor Lib "user32" _
(ByVal hcur As Long, ByVal id As Long) As Long
Private Declare Function GetCursor Lib "user32" () As Long
Private Declare Function CopyIcon Lib "user32" (ByVal hcur As Long) As Long
Private Const OCR_NORMAL = 32512
Public lngOldCursor As Long, lngNewCursor As Long
Public Sub StartAnimatedCursor(AniFilePath As String)
' Create a copy of the current cursor,
' for Windows NT compatibility
lngOldCursor = CopyIcon(GetCursor())
' Check the passed string, if it contains
' a solid file path, then load the cursor
' from file. If not, add the App.Path,
' *then* load cursor...
If InStr(1, AniFilePath, "\") Then
lngNewCursor = LoadCursorFromFile(AniFilePath)
Else
lngNewCursor = LoadCursorFromFile(App.Path & _
"\" & AniFilePath)
End If
' Activate the cursor
SetSystemCursor lngNewCursor, OCR_NORMAL
End Sub
Public Sub RestoreLastCursor()
' Restore last cursor
SetSystemCursor lngOldCursor, OCR_NORMAL
End Sub
Private Sub Command1_Click()
StartAnimatedCursor ("C:\Deepak\Downloads\Icons\ani\3db2bus1.ani")
MsgBox "Start long process here..."
RestoreLastCursor
End Sub
Sep 7th, 2004, 12:57 AM
#4
Sep 7th, 2004, 01:02 AM
#5
Thread Starter
Fanatic Member
actually.. is not the cursor that i want to animate.. i want to animate a picture in the picture box.. can that be done during the registration process?
Sep 7th, 2004, 01:11 AM
#6
u can use WebBrowser ActiveX control to display animated gif file within your program.
Sep 7th, 2004, 01:12 AM
#7
here is how
Add the WebBrowser ActiveX control to your form. go to Project >> Components, then mark the 'Microsoft Internet Controls' check box, and press OK.
VB Code:
Private Sub Form_Load()
'Replace 'C:\myDir\myFile.gif' with your GIF file.
'the following two lines should be written in one line
WebBrowser1.Navigate "about :<html><body scroll='no'><img src='C:\myDir\myFile.gif'></img></body></html>"
End Sub
Sep 7th, 2004, 01:17 AM
#8
or use this third party dll.
Copy this file to C:\WINNT\SYSTEM32
Add it to ur form from Project >> Components
Attached Files
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width