Remove border from popup button

  • Thread starter Thread starter Eran.Yasso
  • Start date Start date
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.
 
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
 
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.
 
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.
 
Back
Top