Raised panel?

  • Thread starter Thread starter Zoltan Hernyak
  • Start date Start date
Z

Zoltan Hernyak

Hi,

I am sure it was asked before, but I don't know the answer.
How can I put a raised panel onto my form? The original panel
can act only flat or sinked appaerance...

In Delphi I can set the outer border to be raised/lowered as well
as the inner border... I can't do that in .NET? Why? Or am I
just a stupid AlwaysWantsEverything programmer?

zoltan
 
Panel has only 2 standard predefined borders in .Net - see BorderStyle
property. Or none.

If you want more, you need to use Win32 API SetWindowLong, which allows to
have some more, however not in all cases.
Otherwise you have to override DefWindowProc, intercept WM_NCPAINT and draw
your frame yourself. Which is more than anybody would wish. Too much fuss
for nothing. See Platform SDK for details.

HTH
Alex
 
Try this:

Public Class PanelEx
Inherits Panel
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim params As CreateParams = MyBase.CreateParams()
params.Style = params.Style Or &H400000
Return params
End Get
End Property
End Class

/claes
 
Back
Top