Elipse style fill gradient in a rectangle?

A

Adam Maltby

Hi does anyone know how to fill a rectangle with an ellipse style fill (ie so it gives a spotlight effect on a rectange?)

I know how to create rectangles, ellipses etc and I can fill the rect with an oversized ellipse, but given how far over the edge of the view it has to go, it loses the defining edges on the colours..... I need the fill to go out as far as the outer ellipse colour, and then the rest of the visible form take that colour.... I tried just setting the background colour on the form directly as an easy option, but that in turn discoloursmy flat buttons..... doh!

Please help.....

Cheers
Adam
 
K

Ken Tucker [MVP]

Hi,

Try drawing the forms background in the paint event instead of
setting the back color.

Ken
-----------------------
Hi does anyone know how to fill a rectangle with an ellipse style fill (ie
so it gives a spotlight effect on a rectange?)

I know how to create rectangles, ellipses etc and I can fill the rect with
an oversized ellipse, but given how far over the edge of the view it has to
go, it loses the defining edges on the colours..... I need the fill to go
out as far as the outer ellipse colour, and then the rest of the visible
form take that colour.... I tried just setting the background colour on the
form directly as an easy option, but that in turn discolours my flat
buttons..... doh!

Please help.....

Cheers
Adam
 
A

Adam Maltby

Ken,

Thanks matey! So obvious, right under my nose i never even considered it! Doh!

Thanks again!
Adam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top