Hi everybody,
I have a form (inherits from Form) that has its proprietary title bar and
and a footer section. I'd like to prevent the user from placing any
control in those areas. That is, I'd like to define a deviating area on
which controls may be placed. If i.e. a TableLayoutPanel is placed on the
form and the Dock-property is set to "Fill", this needs to be the area
that I define.
I was assuming that it'd be sufficient to create a Designer that (just as
with other controls) utilizes OnPaintAdornments to define/restrict the area
where controls can be dropped.
However, my designer is simply being ignored - none of the events there are
being fired!?
The scenario roughly looks like the following:
--- 8< ---
<ToolboxBitmap(GetType(Form)), Designer(GetType(My_Form_Designer))> _
Public Class MyForm
Inherits System.Windows.Forms.Form
'...
End Class
Public Class My_Form_Designer
Inherits ParentControlDesigner
'...
Protected Overrides Sub OnPaintAdornments( _
ByVal pe As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaintAdornments(pe)
'...
End Sub
End Class
--- 8< ---
The above designer's code should react if I add a messagebox-line and
create a new form MyForm in a project. Unfortunately, nothing happens at
all (no matter where I place a messagebox).
Hence, is there any additional things one needs to implement in order to
create a forms-designer? Any other base-designer I need to use or
interfaces I would need to implement? Also, why would the behaviour of a
forms-designer differ from that of other controls?
I found many references on the web that were geared at control designers,
but none of them explicitly addressed forms ...
Cheers,
Olaf
---
X-Posted, F'up to microsoft.public.dotnet.framework.windowsforms