Is there a way to set the margins in a label.

Specifically, what I need to do is make sure that the text begins 6 pixels
to the left of the label border and that the baseline of the text is 5
pixels above the lower border of the label.

Is there any way to accomplish this with the standard label or am I going to
have to create my own label control?

Thanks.

Pete Davis

Re: Setting a margin in a label by hirf-spam-me-here

hirf-spam-me-here
Wed Jun 02 12:53:06 CDT 2004

* <pdavis68@hotmail.com> scripsit:
> Specifically, what I need to do is make sure that the text begins 6 pixels
> to the left of the label border and that the baseline of the text is 5
> pixels above the lower border of the label.
>
> Is there any way to accomplish this with the standard label or am I going to
> have to create my own label control?

That's not supported by the standard label, but you can create a control
that inherits the label and overrides its 'OnPaint' method. There you
can place your custom drawing code.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Re: Setting a margin in a label by pdavis68

pdavis68
Wed Jun 02 12:42:46 CDT 2004

That's what I figured. Just thought I'd check. Thanks.

Pete

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:2i6ih3FjhjnnU1@uni-berlin.de...
> * <pdavis68@hotmail.com> scripsit:
> > Specifically, what I need to do is make sure that the text begins 6
pixels
> > to the left of the label border and that the baseline of the text is 5
> > pixels above the lower border of the label.
> >
> > Is there any way to accomplish this with the standard label or am I
going to
> > have to create my own label control?
>
> That's not supported by the standard label, but you can create a control
> that inherits the label and overrides its 'OnPaint' method. There you
> can place your custom drawing code.
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>