Hi Matt,
Thanks for your feedback.
> I've monitored the output windows during runtime, so I know the splitter
is enabled,
Do you mean that you see the below Debug.WriteLine line outputs "true"
value?
If Me.DesignMode = True Then
Splitter1.Enabled = True
Debug.WriteLine(Splitter1.Enabled)
Else
Splitter1.Enabled = False
End If
>however I just can't get it to activate when designmode=true
I assume you mean that, although the Debug.WriteLine outputs
Splitter1.Enabled to be true, it still can not get any focus. This is your
concern, yes?
In the above statement, does the "designmode=true" mean DesignMode in
VS.net designer, or mean the DesignMode in your application design-time
support implementation? I suspect the latter.
Currently, because I did not have your runtime designer implementation
code, I can not understand what going wrong and can not give very useful
suggestion. But in design-time, the control's behavior is hooked by the
ControlDesigner associated with it. More specificly, Winform applied
System.Windows.Forms.Design.SplitterDesigner to Splitter control. I think
you can use Reflector to view the source code of
System.Windows.Forms.Design.SplitterDesigner to get more information of its
design-time behavior.
Normally, Splitter control shows focus through a design-time border
rectangle, which is drawn by SplitterDesigner.DrawBorder method.
SplitterDesigner.DrawBorder is called in SplitterDesigner.OnPaintAdornments
like this:
protected override void OnPaintAdornments(PaintEventArgs pe)
{
Splitter splitter1 = (Splitter) base.Component;
base.OnPaintAdornments(pe);
if (splitter1.BorderStyle == BorderStyle.None)
{
this.DrawBorder(pe.Graphics);
}
}
Its parent class method is: ControlDesigner.OnPaintAdornments, which is
finally called in ControlDesigner.WndProc with message: 15, that is
WM_PAINT for the control.
So you can follow this call stack to analysis why the focus border does not
appear in your application at "DesignMode".
Hope this helps.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.