how to delete the black border of button control?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
Another way would be to set the region of the button to a rectangle based
upon the buttons clientrectangle inflated by (-1,-1)
 
Back
Top