|
-
Jul 25th, 2001, 06:00 PM
#1
Thread Starter
PowerPoster
Putting a progress bar and an icon into the status bar.
How do I draw a progress bar and an icon into the status bar control?
-
Jul 25th, 2001, 06:12 PM
#2
Member
For an icon, just use the Picture property. Unless you are talking about an *icon*, like .ico, which I don't know if it supports as I only use BMPs in StatusBars.
Don't think you can do a statusbar with a progress bar in it unless you chuck a picturebox or something on top of it and ZOrder it.
-
Jul 25th, 2001, 06:24 PM
#3
You can use the SetParent API to make the Statusbar the container for the Progressbar, i.e.
VB Code:
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Form_Load()
StatusBar1.Panels.Add , "ICON", , , LoadPicture("C:\Program Files\Microsoft Visual Studio\Common\Graphics\Icons\Misc\Face02.ico")
ProgressBar1.Move 0, 24, StatusBar1.Panels(1).Width, StatusBar1.Height - 24
SetParent ProgressBar1.hWnd, StatusBar1.hWnd
ProgressBar1.Value = 50
End Sub
-
Jul 25th, 2001, 06:39 PM
#4
Thread Starter
PowerPoster
for the icon, can it be changed to an animated gif?
-
Jul 26th, 2001, 03:14 AM
#5
Hyperactive Member
ei you could add an image list and loop through them to simulate an animated icon.
VB Code:
Dim Counter As Integer
Private Sub Timer1_Timer()
Counter = Counter + 1
StatusBar1.Panels(3).Picture = ImageList1.ListImages(Counter).Picture
If Counter > ImageList1.ListImages.Count - 1 Then Counter = 0
End Sub
-
Jul 26th, 2001, 04:09 AM
#6
Registered User
I can't say I think an animated icon in a status bar would look professional.
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
|