469,290 Members | 1,872 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

Button border issue in flat style

Hi,
I created a button with flat style appearance and with border size set to 0.

When the button is in focus it gets a border. How can I get rid of the border?

Thanks Shaul

May 11 '07 #1
3 12522
I have not tried this but check it out:
http://forums.microsoft.com/msdn/Sho...54952&SiteID=1

"Shauli" wrote:
Hi,
I created a button with flat style appearance and with border size set to 0.

When the button is in focus it gets a border. How can I get rid of the border?

Thanks Shaul
May 11 '07 #2

I found some sulotions for this isuue.

like inherit the button class or implement the onPaint -

protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
if (this.Focused)
{
Rectangle focusrec = pe.ClipRectangle;
focusrec.Inflate(-4, -4);
ControlPaint.DrawFocusRectangle(pe.Graphics, focusrec, Color.Blue,
Color.Blue);
}
}


There was another solution, much more simple one -

"You can remove it by right-click to desktop -select appearance tab ->
Effects button -select "Hide underlined letters for keyboard navigation
Until I press the Alt key" then apply this settings of course
and voila here they are gone "

hope it will help others

May 11 '07 #3
Create your own Control which acts like a button.

Use the "Creating Custom Buttons by Implementing IButtonControl" example on
my site and just implement your own OnPaint and OnPaintBackground methods.
http://www.dotnetrix.co.uk/buttons.html

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Shauli" <Sh****@discussions.microsoft.comwrote in message
news:C3**********************************@microsof t.com...
Hi,
I created a button with flat style appearance and with border size set to
0.

When the button is in focus it gets a border. How can I get rid of the
border?

Thanks Shaul

May 11 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by not 2 swift | last post: by
6 posts views Thread by Skip Hollowell | last post: by
1 post views Thread by Wilhelm Kutting | last post: by
5 posts views Thread by JohnSouth | last post: by
10 posts views Thread by IkBenHet | last post: by
9 posts views Thread by Ray Muforosky | last post: by
7 posts views Thread by redneon | last post: by
7 posts views Thread by Maileen | last post: by
3 posts views Thread by Jason Richmeier | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.