Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transparent GIF button image

Status
Not open for further replies.

SuryaF

Programmer
May 21, 2006
100
DE
I'm trying to set a transparent image for a command button.
Of course, I have a GIF file but when I try selecting it for the button it gives me the following error:

"Access doesn't support the format of the file ..., or the file is too large. Try converting the file to BMP or GIF format."

Now the file is a tiny 149 bytes (!) file.

Of course I can convert it to BMP but I lose transparency.
If I put the background on Greyish it will look wierd on a computer with different Windows theme.

Anybody has any idea what I need to do?
Thanks!
 
You can use bitmap with transparency just as long as the background is white behind you image.
 
But I can't change the background of a command button, can I?
 
No, not that I know of. I think you can make a picture larger than your button, with the color you want then put an image in the center.
 
Thanks for your answers m3rc.
Even with a larger picture it leaves a gray border and it's not working for me.
What I'm looking for is a way to add a picture similar with the ones coming with Access. They are gifs, that's for sure.

 
Can you insert the image onto a form at all? If so, just put a transparent button on top of it.

TMTOWDI - it's not just for Perl any more
 
I see what you mean but that doesn't look and behave like a button from user's perspective.
I can set the image Raised (special effect) but it still doesn't go down when you click on it, you know?
 
Another option is converting it into an icon and making it transparent. Depending on if your button is larger than your image it may look off a little the transparency from an icon on a button leaves a haze.
 
Code:
Private Sub imgPseudoButton_MouseDown()
    imgPseudoButton.SpecialEffect = 2
End Sub

Private Sub imgPseudoButton_MouseUp()
    imgPseudoButton.SpecialEffect = 1
End Sub

Private Sub imgPseudoButton_Click()
    'Your Code Here
End Sub
And simply dispense with the button altogether. I've done this with Label contols to achieve customized buttons. If your image will go onto a form at all, you should be able to use this.


TMTOWDI - it's not just for Perl any more
 
Thanks adalger, good idea! A star for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top