I'm using a panel as a pop up dialog...but it displays the pop up without a
border...I can't figure out how to add a nice solid border to it.

Re: howto add solid line to border of a panel by Alex

Alex
Wed Oct 22 14:49:17 CDT 2003

Why not use a dialog?

"rocio" <rocio.katsanis@softwareservices.net> wrote in message
news:uySUvSNmDHA.684@TK2MSFTNGP09.phx.gbl...
> I'm using a panel as a pop up dialog...but it displays the pop up without
a
> border...I can't figure out how to add a nice solid border to it.
>
>
>



Re: howto add solid line to border of a panel by Lloyd

Lloyd
Wed Oct 22 19:02:33 CDT 2003

go there
http://www.ihook.cc

then open source.
in this library there a PocketDialog class which is in fact a Panel.
but has a title & is dragable !

> Alex: whynot a Dialog ?
or a Form with ShowDialog() ?

simply because sometimes and for some undetermined reason it cause my
application to go background, and then I found noway whatsoever to bring to
front again automatically !
(and yest I did try some win32 calls ....)

"rocio" <rocio.katsanis@softwareservices.net> wrote in message
news:uySUvSNmDHA.684@TK2MSFTNGP09.phx.gbl...
> I'm using a panel as a pop up dialog...but it displays the pop up without
a
> border...I can't figure out how to add a nice solid border to it.
>
>
>



Re: howto add solid line to border of a panel by Alex

Alex
Wed Oct 22 19:29:22 CDT 2003

> > Alex: whynot a Dialog ?
> or a Form with ShowDialog() ?
>
> simply because sometimes and for some undetermined reason it cause my
> application to go background, and then I found noway whatsoever to bring
to
> front again automatically !
> (and yest I did try some win32 calls ....)

Speaking of which... Care to try something new?

IntPtr hWnd = FindWindow("#NETCF_AGL_PARK_",
System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQuali
fiedName);
if ( hWnd != IntPtr.Zero )
SendMessage( hWnd, 0x8001, 0, 0);

This is supposed to bring the application to foreground reliably.




Re: howto add solid line to border of a panel by Lloyd

Lloyd
Thu Oct 23 01:31:49 CDT 2003

try to understand....

> Speaking of which... Care to try something new?
>
> IntPtr hWnd = FindWindow("#NETCF_AGL_PARK_",
>
System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQuali
> fiedName);
this return the 1st window in the windows list own by my app, doesn't it ?

> if ( hWnd != IntPtr.Zero )
> SendMessage( hWnd, 0x8001, 0, 0);
what is 0x8001 ?
which MSG I mean ....

>
> This is supposed to bring the application to foreground reliably.
>
thanks for this great tip !



Re: howto add solid line to border of a panel by Lloyd

Lloyd
Thu Oct 23 01:33:34 CDT 2003

ho.................
thanks Alex for this........ dazzling peace of code.
I'll try that !

"Alex Feinman [MVP]" <public_news@alexfeinman.com> wrote in message
news:ORAn1yPmDHA.2776@tk2msftngp13.phx.gbl...
> > > Alex: whynot a Dialog ?
> > or a Form with ShowDialog() ?
> >
> > simply because sometimes and for some undetermined reason it cause my
> > application to go background, and then I found noway whatsoever to bring
> to
> > front again automatically !
> > (and yest I did try some win32 calls ....)
>
> Speaking of which... Care to try something new?
>
> IntPtr hWnd = FindWindow("#NETCF_AGL_PARK_",
>
System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQuali
> fiedName);
> if ( hWnd != IntPtr.Zero )
> SendMessage( hWnd, 0x8001, 0, 0);
>
> This is supposed to bring the application to foreground reliably.
>
>
>



Re: howto add solid line to border of a panel by Paul

Paul
Thu Oct 23 02:12:02 CDT 2003

rocio,

Use two panels:
The first backcolour = black
The second on top of the first at 1,1 and 2 pixels smaller on both
dimensions and white or whatever color you want.
Adjust the above to get whatever thickness/border colour you want.

Paul K.

"rocio" <rocio.katsanis@softwareservices.net> wrote in message
news:uySUvSNmDHA.684@TK2MSFTNGP09.phx.gbl...
> I'm using a panel as a pop up dialog...but it displays the pop up without
a
> border...I can't figure out how to add a nice solid border to it.
>
>
>



Re: howto add solid line to border of a panel by chris-s

chris-s
Thu Oct 23 03:07:36 CDT 2003

Try this custom frame class that has a BorderStyle...

Cheers,

Chris


public class I8Frame : System.Windows.Forms.Panel

{

private BorderStyle _BorderStyle;

public I8Frame()

{

_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);

}



}



"rocio" <rocio.katsanis@softwareservices.net> wrote in message
news:uySUvSNmDHA.684@TK2MSFTNGP09.phx.gbl...
> I'm using a panel as a pop up dialog...but it displays the pop up without
a
> border...I can't figure out how to add a nice solid border to it.
>
>
>



Re: howto add solid line to border of a panel by William

William
Thu Oct 23 08:01:21 CDT 2003

Alex:

Thanks for the cool post. This rocks!
"Alex Feinman [MVP]" <public_news@alexfeinman.com> wrote in message
news:ORAn1yPmDHA.2776@tk2msftngp13.phx.gbl...
> > > Alex: whynot a Dialog ?
> > or a Form with ShowDialog() ?
> >
> > simply because sometimes and for some undetermined reason it cause my
> > application to go background, and then I found noway whatsoever to bring
> to
> > front again automatically !
> > (and yest I did try some win32 calls ....)
>
> Speaking of which... Care to try something new?
>
> IntPtr hWnd = FindWindow("#NETCF_AGL_PARK_",
>
System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQuali
> fiedName);
> if ( hWnd != IntPtr.Zero )
> SendMessage( hWnd, 0x8001, 0, 0);
>
> This is supposed to bring the application to foreground reliably.
>
>
>