|
-
Jul 7th, 2000, 04:38 AM
#1
Thread Starter
Junior Member
I have been writing an application for a client and it is basically finnished. However they want tooltiptext hoverovers for each button.
It is using the BitBlt function (below), to replace images displayed in various pictureboxes cut from one large image (skin). During the mouseup, mousedown and mousemove events.
I have set the tooltiptext property for each button(picturebox) at design time. The tooltiptext's are displayed when no image is loaded, but not when the picturebox contains an image. WHY?
Code:
Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long.
[Edited by charliecatney on 07-07-2000 at 11:44 AM]
-
Jul 7th, 2000, 05:00 AM
#2
Lively Member
Why are you using bitblt? It is probably causing the problem.
Bitblt just 'manually' writes data over the screen, so the chances are it is interfering with the tooltip display.
-
Jul 7th, 2000, 05:09 AM
#3
Member
I don't know.
I've just try to put tiptext for two picturebox, one with an image, the otherone without. And it works! So, I don't know. Maybye benski is right when he said that would come from the BitBlt !
-
Jul 7th, 2000, 05:10 AM
#4
Thread Starter
Junior Member
Benski,
The application allows users to download alternative skins. They just download 1 large image and Bitblt cuts out the various images for each button(picturebox). The code to replace a skin is as follows.
Code:
Public Const SRCCOPY = &HCC0020
Public Sub LoadIFace()
'Load frmToolbar background
Call BitBlt(frmToolbar.picActPor.hDC, 0, 0, 152, 38, frmToolbar.picSourceImage.hDC, 476, 0, SRCCOPY)
frmToolbar.picActPor.Refresh
Call BitBlt(frmToolbar.hDC, 0, 0, (frmToolbar.Width / Screen.TwipsPerPixelX), 118, frmToolbar.picSourceImage.hDC, 0, 114, SRCCOPY)
frmToolbar.Refresh
'Load Info button graphic
Call BitBlt(frmToolbar.picHome.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 0, 0, SRCCOPY)
frmToolbar.picHome.Refresh
'Load Refresh button graphic
Call BitBlt(frmToolbar.picNews.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 38, 0, SRCCOPY)
frmToolbar.picNews.Refresh
'Load Prefs button graphic
Call BitBlt(frmToolbar.picEntertainment.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 76, 0, SRCCOPY)
frmToolbar.picEntertainment.Refresh
'Load Customise button graphic
Call BitBlt(frmToolbar.picSport.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 114, 0, SRCCOPY)
frmToolbar.picSport.Refresh
'Load Games button graphic
Call BitBlt(frmToolbar.picWeather.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 152, 0, SRCCOPY)
frmToolbar.picWeather.Refresh
'Load Games button graphic
Call BitBlt(frmToolbar.picMail.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 228, 0, SRCCOPY)
frmToolbar.picMail.Refresh
Call BitBlt(frmToolbar.picMediaPlayer.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 380, 0, SRCCOPY)
frmToolbar.picMediaPlayer.Refresh
Call BitBlt(frmToolbar.picSearch.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 304, 0, SRCCOPY)
frmToolbar.picSearch.Refresh
Call BitBlt(frmToolbar.picChannels.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 266, 0, SRCCOPY)
frmToolbar.picChannels.Refresh
Call BitBlt(frmToolbar.picProperties.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 342, 0, SRCCOPY)
frmToolbar.picProperties.Refresh
Call BitBlt(frmToolbar.picPause.hDC, 0, 0, 54, 54, frmToolbar.picSourceImage.hDC, 190, 0, SRCCOPY)
frmToolbar.picPause.Refresh
Call BitBlt(frmToolbar.picHideTools.hDC, 0, 0, 58, 21, frmToolbar.picSourceImage.hDC, 418, 0, SRCCOPY)
frmToolbar.picHideTools.Refresh
Call BitBlt(frmToolbar.picHideTicker.hDC, 0, 0, 58, 21, frmToolbar.picSourceImage.hDC, 514, 0, SRCCOPY)
frmToolbar.picHideTicker.Refresh
End Sub
[Edited by charliecatney on 07-07-2000 at 11:45 AM]
-
Jul 7th, 2000, 09:03 AM
#5
Try assigning the image to the Picture property after the call to BitBlt:
Code:
Public Sub LoadIFace()
'Load frmToolbar background
Call BitBlt(frmToolbar.picActPor.hDC, 0, 0, 152, 38, frmToolbar.picSourceImage.hDC, 476, 0, SRCCOPY)
frmToolbar.picActPor.Refresh
frmToolbar.picActPor.Picture = frmToolbar.picActPor.Image
frmToolbar.picActPor.Cls
-
Jul 7th, 2000, 09:39 AM
#6
Thread Starter
Junior Member
Unfortunatly that didn't work Joacim.
If what benski says and the image returned from BitBlt is not assigned to the picture property of the picturebox but just displayed on top of it.
I need to assign the generated image from the BitBlt to the picture property of the picturebox and then remove the overlay image so that the picturebox is on top and the tooltiptext works.
Would anyone know how to do this?
Any help would be appreciated.
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
|