Okay ... I'm frustrated. I can create a backcolor for a control or panel,
but I can't create a border. How can I do this?

The only way I've found is to stack on panel over another, with the back
panel set to black and slighly bigger than the panel that sits on it, which
is set to white.

Help? Thanks!

Re: Border on generic Control or Panel? by Tim

Tim
Tue Mar 28 17:42:29 CST 2006

There are some suggestions at the link below.
http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/8e77b99d09a50dca/cfc8bfd75473b7a0?hl=en#cfc8bfd75473b7a0

--
Tim Wilson
.NET Compact Framework MVP

"Wade" <wwegner23NOEMAILhotmail.com> wrote in message
news:uJCWJAsUGHA.5332@tk2msftngp13.phx.gbl...
> Okay ... I'm frustrated. I can create a backcolor for a control or panel,
> but I can't create a border. How can I do this?
>
> The only way I've found is to stack on panel over another, with the back
> panel set to black and slighly bigger than the panel that sits on it,
which
> is set to white.
>
> Help? Thanks!
>
>



Re: Border on generic Control or Panel? by Wade

Wade
Tue Mar 28 17:50:56 CST 2006

Nevermind ... found a great solution -- thanks chris-s.

public class IFrame : System.Windows.Forms.Panel
{
private BorderStyle _BorderStyle;

public IFrame()
{
_BorderStyle = BorderStyle.FixedSingle;
}

public BorderStyle BStyle
{
get { return this._BorderStyle; }
set { this._BorderStyle = value; Invalidate(); }
}

protected override void OnPaint(PaintEventArgs pea)
{
base.OnPaint(pea);

using (Pen pe = new Pen(Color.Black))
{
switch (this.BStyle)
{
case BorderStyle.FixedSingle:

pea.Graphics.DrawRectangle(pe, 0, 0, this.Width - 1,
this.Height - 1);
break;

case BorderStyle.Fixed3D:

pea.Graphics.DrawRectangle(pe,
this.ClientRectangle);
break;

case BorderStyle.None:

break;
}
}
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
}

Wade" <wwegner23NOEMAILhotmail.com> wrote in message
news:uJCWJAsUGHA.5332@tk2msftngp13.phx.gbl...
> Okay ... I'm frustrated. I can create a backcolor for a control or panel,
> but I can't create a border. How can I do this?
>
> The only way I've found is to stack on panel over another, with the back
> panel set to black and slighly bigger than the panel that sits on it,
> which is set to white.
>
> Help? Thanks!
>