.NET Framework - Remove border from popup button More options

Asked By Eran.Yass on 07-Mar-07 11:30 AM
Hi all,

Originally, I posted this post in
microsoft.public.dotnet.languages.csharp.
I was offered to try get answer here.

I am writing my app in C#.

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?

The problem is that the popup button doesn't look popup in its current
graphic.

Thanks,
Eran.




ClayB replied on 07-Mar-07 01:29 PM
I may be missing the point of your question but if you do not want to
see a border until you move the mouse over the button, you might try
using a panel instead of a button. You could start out with no border
and then show/hide the border in the panel's MouseEnter and MouseLeave
events.

this.panel1.BorderStyle = BorderStyle.None;
this.panel1.MouseEnter += new
EventHandler(panel1_MouseEnter);
this.panel1.MouseLeave += new
EventHandler(panel1_MouseLeave);


void panel1_MouseLeave(object sender, EventArgs e)
{
this.panel1.BorderStyle = BorderStyle.None;
}

void panel1_MouseEnter(object sender, EventArgs e)
{
this.panel1.BorderStyle = BorderStyle.Fixed3D;
}

====================
Clay Burch
Syncfusion, Inc.
Eran.Yass replied on 07-Mar-07 04:50 PM
Hello Clay and thanks for the reply.
I liked what you suggested. The problem with this border style is that
it looks sunken 3d instead of raised.