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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making parts of a form background image transparent?? 1

Status
Not open for further replies.

nexius

Programmer
Jul 8, 2000
109
CA
Hi

At the moment I have a borderless form with a GIF image as it's background. In Paint Shop Pro, I applied a transparency to a certain color in the image, which I want to be transparent on the form.

What happens is it looks fine when you first load it (the transparency works) but when you move the form, it doesn't redraw the parts that are transparent, and the pixels that were there at the beginning move along with the form.

How do I get it to redraw this??

Thanks,

-neX
 
you need to refresh the parant form, of the form that contains the gif, when you move the gif-form. do this using myParantForm.Refresh()

____________________________________________________
If you like a post, show you care by giving it a star.
 
Thanks for your reply, however I still can't get it to work.

I added an eventhandler for every time the form is moved, and inside have written:

this.Refresh()

But this doesn't appear to do anything. So I tried this, like you suggested:

this.ParentForm.Refresh()

But it gave me a runtime error since I only have one form, and this.ParentForm is therefore null....

Any idea what I'm doing wrong?
 
well it still looks like a refresh problem. try refreshing every dependant of the gif form (ie, its parent, its parent's parent), and the gif form itself.

if that doesn't get it, then buffer the gif and re apply it every time the form it's on is refreshed.

____________________________________________________
If you like a post, show you care by giving it a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top