473,788 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12725
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(PaintEv entArgs pe)
{
base.OnPaint(pe );
if (this.Focused)
{
Rectangle focusrec = pe.ClipRectangl e;
focusrec.Inflat e(-4, -4);
ControlPaint.Dr awFocusRectangl e(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 OnPaintBackgrou nd methods.
http://www.dotnetrix.co.uk/buttons.html

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Shauli" <Sh****@discuss ions.microsoft. comwrote in message
news:C3******** *************** ***********@mic rosoft.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5966
by: not 2 swift | last post by:
I thought I would update an old page on which I had used a <INPUT TYPE=image ...> with a <BUTTON><IMG SRC=...></BUTTON> The problem is that <BUTTON> always provides a shadow/emboss effect. Can I get rid of that? If the old <INPUT> button has been deprecated in favor of <BUTTON>, have all it's button functions been duplicated? Thanks for any help,
6
7559
by: Skip Hollowell | last post by:
I am working on a menu bar for a site, and am using buttons in the bar (because the customer wants to use accessKeys for each selection, apparently it is too much work to click on them with a mouse, but I digress) It seems that the longer the text is in a button, the more padding there is around that text in the button, thus making the button itself much to wide, and wasting too much space on the page. I have tried width:auto in the...
1
3030
by: Wilhelm Kutting | last post by:
hello, i have the following html. I like to have standard submit-Buttons and no flat ones. The problem is that i cannot reset the border value for input completely. The flat button remains. is there something i can do about it? <style type="text/css">
5
35728
by: JohnSouth | last post by:
Hi I've an image submit button on a form that needs to appear flat on the surface. I can't get rid of the shadow that appears bottom and right. This is the best I can do. <code> ..SearchButton { width=100;
10
1472
by: IkBenHet | last post by:
Hello, I am creating a toolbar for an richtext editor. I already managed to make the images act as buttons (hovering,...) But now I want to be able to keep a button selected (down) when clicking on it. An example: when a user clicks the "Bold" button, this button must appear to be selected until the user again clicks on it. Like you have in all regular texteditors like M$ Word. The code:
9
66527
by: Ray Muforosky | last post by:
Hello, Is there a way to render a text or button tag without a sunken or raised surface respectively. Ray
7
13903
by: redneon | last post by:
Is it possible to change the border colour of a button whos FlatStyle is set to Flat? It's be nice to be able to change the width of the border too. Any ideas? Darrell
7
3358
by: Maileen | last post by:
Hi, I asked few days ago about a flat button control under VB.NET but answer didn't satisfy me. I know that a such button existed under VB6 so it should exist under VB.NET also. Where can i find this Flat button control ? COM, ActiveX ?
3
1217
by: Jason Richmeier | last post by:
I have come across something that I cannot seem to find a solution for and would like to know if anyone else has either seen the same thing and/or (even better) has a solution. If I set the BorderSize for a flat-style button on a Windows form, the border is correctly drawn in the designer but it is drawn as being one pixel wider at runtime. For example, if I set the BorderSize equal to 1, in the designer, the border will be drawn 1...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.