how to delete the black border of button control?

G

Guest

Hello, everyone:

when I use a image as background of a windows button control, the control
alway has a border around the image no matter I set the flatstyle as flat,
standard, or popup.

I want to set the button's flatstysle as flat since the button's image is
part of background of form, but I hate the black border around the button.

could anyone help out? I do appreciate your help.

haiwen
 
M

Mick Doherty

The border takes the color of the text. If you have no text then set the
buttons forecolor to Transparent.
If you want text then you'll need to draw it in the buttons paint() method.
 
G

Guest

Mick:

Thanks so much for your reply. After I set the forecolor to transparent. The
black borders disappear, but there are two white lines on the top and left
side of button when the flatstyle is set as standard or flat. if it's set as
popup, then there are four flur white lines around the button.

Anyway, if there is not easy way to get rid of them, I will use an
alternative way that makes all background color as black and set the
forecolor as black too.

thanks again.

haiwen
 
M

Mick Doherty

Another way would be to set the region of the button to a rectangle based
upon the buttons clientrectangle inflated by (-1,-1)
 

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