PC Review


Reply
Thread Tools Rate Thread

Remove the line around the face of a button

 
 
Bruce Schechter
Guest
Posts: n/a
 
      9th Dec 2003

I am creating two buttons ("Forward" and "Back" in a windows forms
application that has a "browsing" function, vaguely like the forward/back
buttons in IE.) Using the VS.NET designer I placed images within each
button to visually show forward and reverse "arrows."



I have not been found a way to remove the edges of the buttons so that only
the images appear (without the surrounding box.) I've searched both the
VS.NET designer as well as all the methods/properties of the Button Class,
but found no way to control that attribute of the Button appearance.



How can this be done?



Thanks,

-- Bruce


 
Reply With Quote
 
 
 
 
Picho
Guest
Posts: n/a
 
      9th Dec 2003
Bruce,

Why dont you create a class that derives from button and overrides the
OnPaint method?

Picho

"Bruce Schechter" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> I am creating two buttons ("Forward" and "Back" in a windows forms
> application that has a "browsing" function, vaguely like the forward/back
> buttons in IE.) Using the VS.NET designer I placed images within each
> button to visually show forward and reverse "arrows."
>
>
>
> I have not been found a way to remove the edges of the buttons so that

only
> the images appear (without the surrounding box.) I've searched both the
> VS.NET designer as well as all the methods/properties of the Button Class,
> but found no way to control that attribute of the Button appearance.
>
>
>
> How can this be done?
>
>
>
> Thanks,
>
> -- Bruce
>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      9th Dec 2003
* "Bruce Schechter" <(E-Mail Removed)> scripsit:
> I am creating two buttons ("Forward" and "Back" in a windows forms
> application that has a "browsing" function, vaguely like the forward/back
> buttons in IE.) Using the VS.NET designer I placed images within each
> button to visually show forward and reverse "arrows."
>
> I have not been found a way to remove the edges of the buttons so that only
> the images appear (without the surrounding box.) I've searched both the
> VS.NET designer as well as all the methods/properties of the Button Class,
> but found no way to control that attribute of the Button appearance.


Place a toolbar control on the form, add two buttons to it and set its
'Appearance' property to 'Flat'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
Mallikarjun Tuppad
Guest
Posts: n/a
 
      9th Dec 2003
In the toolbar buttons look flat without border.

But the toolbar itself draws a border at top even when broder is set to
NONE -

Any work arounds to get rid of that.

Mallik


"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:br49h3$28fn70$(E-Mail Removed)...
> * "Bruce Schechter" <(E-Mail Removed)> scripsit:
> > I am creating two buttons ("Forward" and "Back" in a windows forms
> > application that has a "browsing" function, vaguely like the

forward/back
> > buttons in IE.) Using the VS.NET designer I placed images within each
> > button to visually show forward and reverse "arrows."
> >
> > I have not been found a way to remove the edges of the buttons so that

only
> > the images appear (without the surrounding box.) I've searched both the
> > VS.NET designer as well as all the methods/properties of the Button

Class,
> > but found no way to control that attribute of the Button appearance.

>
> Place a toolbar control on the form, add two buttons to it and set its
> 'Appearance' property to 'Flat'.
>
> --
> Herfried K. Wagner [MVP]
> <http://www.mvps.org/dotnet>



 
Reply With Quote
 
Tim Wilson [MVP]
Guest
Posts: n/a
 
      9th Dec 2003
Set the Divider property of the ToolBar to false:

[C#]
this.toolBar1.Divider = false;

[VB.Net]
Me.ToolBar1.Divider = False

.... these examples are given as code but you can easily change the Divider
property through the Properties grid.

--
Tim Wilson
..Net Compact Framework MVP

"Mallikarjun Tuppad" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> In the toolbar buttons look flat without border.
>
> But the toolbar itself draws a border at top even when broder is set to
> NONE -
>
> Any work arounds to get rid of that.
>
> Mallik
>
>
> "Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
> news:br49h3$28fn70$(E-Mail Removed)...
> > * "Bruce Schechter" <(E-Mail Removed)> scripsit:
> > > I am creating two buttons ("Forward" and "Back" in a windows forms
> > > application that has a "browsing" function, vaguely like the

> forward/back
> > > buttons in IE.) Using the VS.NET designer I placed images within

each
> > > button to visually show forward and reverse "arrows."
> > >
> > > I have not been found a way to remove the edges of the buttons so that

> only
> > > the images appear (without the surrounding box.) I've searched both

the
> > > VS.NET designer as well as all the methods/properties of the Button

> Class,
> > > but found no way to control that attribute of the Button appearance.

> >
> > Place a toolbar control on the form, add two buttons to it and set its
> > 'Appearance' property to 'Flat'.
> >
> > --
> > Herfried K. Wagner [MVP]
> > <http://www.mvps.org/dotnet>

>
>



 
Reply With Quote
 
Bruce Schechter
Guest
Posts: n/a
 
      9th Dec 2003
Thanks for the recommendation. This approach is likely to work well for me.
However, I'm still new to C# and the WinForms technology... so would anyone
know of a good sample or article on how to do this?
Cheers, Bruce

"Picho" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Bruce,
>
> Why dont you create a class that derives from button and overrides the
> OnPaint method?
>
> Picho
>
> "Bruce Schechter" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> >
> > I am creating two buttons ("Forward" and "Back" in a windows forms
> > application that has a "browsing" function, vaguely like the

forward/back
> > buttons in IE.) Using the VS.NET designer I placed images within each
> > button to visually show forward and reverse "arrows."
> >
> >
> >
> > I have not been found a way to remove the edges of the buttons so that

> only
> > the images appear (without the surrounding box.) I've searched both the
> > VS.NET designer as well as all the methods/properties of the Button

Class,
> > but found no way to control that attribute of the Button appearance.
> >
> >
> >
> > How can this be done?
> >
> >
> >
> > Thanks,
> >
> > -- Bruce
> >
> >

>
>



 
Reply With Quote
 
Bruce Schechter
Guest
Posts: n/a
 
      9th Dec 2003
Herfried,

Thanks for the response. I have never used the ToolBar control before. It
appears that the Toolbar must consume the entire real estate of one edge of
a window. In my case the two buttons would be the only controls on the
toolbar and thus would not be using the Form's real estate efficiently. Pls
let me know if I am not interpreting the situation correctly.

Meanwhile, my gut feel is that the recommendation previous to this one in
the this thread (to create a control that derives from Button and overrides
OnPaint) seems like a good solution for me... if I can find sample code or
a good article.

cheers, Bruce

"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:br49h3$28fn70$(E-Mail Removed)...
> * "Bruce Schechter" <(E-Mail Removed)> scripsit:
> > I am creating two buttons ("Forward" and "Back" in a windows forms
> > application that has a "browsing" function, vaguely like the

forward/back
> > buttons in IE.) Using the VS.NET designer I placed images within each
> > button to visually show forward and reverse "arrows."
> >
> > I have not been found a way to remove the edges of the buttons so that

only
> > the images appear (without the surrounding box.) I've searched both the
> > VS.NET designer as well as all the methods/properties of the Button

Class,
> > but found no way to control that attribute of the Button appearance.

>
> Place a toolbar control on the form, add two buttons to it and set its
> 'Appearance' property to 'Flat'.
>
> --
> Herfried K. Wagner [MVP]
> <http://www.mvps.org/dotnet>



 
Reply With Quote
 
Tim Wilson [MVP]
Guest
Posts: n/a
 
      9th Dec 2003
When using the ToolBar set:
Appearance = Flat
AutoSize = False
Dock = None
Divider = False
then set the size and location.

--
Tim Wilson
..Net Compact Framework MVP

"Bruce Schechter" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Herfried,
>
> Thanks for the response. I have never used the ToolBar control before.

It
> appears that the Toolbar must consume the entire real estate of one edge

of
> a window. In my case the two buttons would be the only controls on the
> toolbar and thus would not be using the Form's real estate efficiently.

Pls
> let me know if I am not interpreting the situation correctly.
>
> Meanwhile, my gut feel is that the recommendation previous to this one in
> the this thread (to create a control that derives from Button and

overrides
> OnPaint) seems like a good solution for me... if I can find sample code

or
> a good article.
>
> cheers, Bruce
>
> "Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
> news:br49h3$28fn70$(E-Mail Removed)...
> > * "Bruce Schechter" <(E-Mail Removed)> scripsit:
> > > I am creating two buttons ("Forward" and "Back" in a windows forms
> > > application that has a "browsing" function, vaguely like the

> forward/back
> > > buttons in IE.) Using the VS.NET designer I placed images within

each
> > > button to visually show forward and reverse "arrows."
> > >
> > > I have not been found a way to remove the edges of the buttons so that

> only
> > > the images appear (without the surrounding box.) I've searched both

the
> > > VS.NET designer as well as all the methods/properties of the Button

> Class,
> > > but found no way to control that attribute of the Button appearance.

> >
> > Place a toolbar control on the form, add two buttons to it and set its
> > 'Appearance' property to 'Flat'.
> >
> > --
> > Herfried K. Wagner [MVP]
> > <http://www.mvps.org/dotnet>

>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      9th Dec 2003
* "Mallikarjun Tuppad" <(E-Mail Removed)> scripsit:
> In the toolbar buttons look flat without border.
>
> But the toolbar itself draws a border at top even when broder is set to
> NONE -


Set 'Dock' to 'None', 'Anchor' to 'None' and 'Divider' to 'False'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
Picho
Guest
Posts: n/a
 
      10th Dec 2003
Bruce,

Talk to me on my e-mail (just remve the no_spam). I will guide you thru
this.

Picho

"Bruce Schechter" <(E-Mail Removed)> wrote in message
news:%23r%(E-Mail Removed)...
> Thanks for the recommendation. This approach is likely to work well for

me.
> However, I'm still new to C# and the WinForms technology... so would

anyone
> know of a good sample or article on how to do this?
> Cheers, Bruce
>
> "Picho" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Bruce,
> >
> > Why dont you create a class that derives from button and overrides the
> > OnPaint method?
> >
> > Picho
> >
> > "Bruce Schechter" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > >
> > > I am creating two buttons ("Forward" and "Back" in a windows forms
> > > application that has a "browsing" function, vaguely like the

> forward/back
> > > buttons in IE.) Using the VS.NET designer I placed images within

each
> > > button to visually show forward and reverse "arrows."
> > >
> > >
> > >
> > > I have not been found a way to remove the edges of the buttons so that

> > only
> > > the images appear (without the surrounding box.) I've searched both

the
> > > VS.NET designer as well as all the methods/properties of the Button

> Class,
> > > but found no way to control that attribute of the Button appearance.
> > >
> > >
> > >
> > > How can this be done?
> > >
> > >
> > >
> > > Thanks,
> > >
> > > -- Bruce
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make text appear as button face =?Utf-8?B?WFA=?= Microsoft Access VBA Modules 1 4th Mar 2007 10:18 PM
Custom face on a button without using clipboard? =?Utf-8?B?TmlnZWw=?= Microsoft Excel Programming 3 15th Oct 2004 02:07 PM
Custom face on a button without clipboard? =?Utf-8?B?TmlnZWw=?= Microsoft Excel Programming 3 15th Oct 2004 02:01 PM
Custom button face without clipboard? =?Utf-8?B?TmlnZWw=?= Microsoft Excel Programming 2 15th Oct 2004 01:46 PM
Inserting a Face ID onto a Command button Denny Behnfeldt Microsoft Excel Programming 5 12th Feb 2004 02:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:46 PM.