Remove border from popup button

E

Eran.Yasso

Hi all,

I have button which its flatstyle is popup. The problem is that it has
border when user doesn't
move the mouse on the button. How can I remove the border that only
when the user moves the mouse cursor on that button, it sets border so
it looks like 3d?

Thanks,
Eran.
 
O

Oliver Sturm

Hello Eran,
I have button which its flatstyle is popup. The problem is that it has
border when user doesn't
move the mouse on the button. How can I remove the border that only
when the user moves the mouse cursor on that button, it sets border so
it looks like 3d?

If I understand your question correctly, this is not possible - not
without at least deriving from the button control and making major changes
to its implementation. Maybe you should try posting your request to
microsoft.public.dotnet.framework.windowsforms.controls, where some expert
may have a ready-made solution for you.


Oliver Sturm
 
E

Eran.Yasso

HelloEran,


If I understand your question correctly, this is not possible - not
without at least deriving from the button control and making major changes
to its implementation. Maybe you should try posting your request to
microsoft.public.dotnet.framework.windowsforms.controls, where some expert
may have a ready-made solution for you.

Oliver Sturm
--http://www.sturmnet.org/blog

Thanks, I'll try it.
 

V3x

Joined
Mar 14, 2012
Messages
1
Reaction score
0
Hi all,

I have button which its flatstyle is popup. The problem is that it has
border when user doesn't
move the mouse on the button. How can I remove the border that only
when the user moves the mouse cursor on that button, it sets border so
it looks like 3d?

Thanks,
Eran.

Hi.

I know this is an old thread, but I have searched a while without finding any reasonably good and simple solution.
As this site scored 1st on my google search, I'm posting my own for others that may want the same thing.

- Create a button, set flatstyle to flat and flatstyle border to 0.

- Add the following functions in the form class,
private void buttonName_MouseEnter(object sender, EventArgs e) {
buttonName.FlatStyle = FlatStyle.Popup;
}
private void buttonName_MouseLeave(object sender, EventArgs e) {
buttonName.FlatStyle = FlatStyle.Flat;
}

- In the properties window for the button, click the lightning icon, scroll down to the MouseEnter and MouseLeave fields and select the appropriate function for each.
 

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