Jeffrey,
Thank you for your reply. I'm sorry for the ambiguity of the first post,
but all of your assumptions were exactly correct. I did some checking, and
as you suspected, my control was not yet sited. I moved the code to the
method below, which is by both the resize and paint events of the control
(I'll figure which is best after it's working). I've monitored the output
windows during runtime, so I know the splitter is enabled, however I just
can't get it to activate when designmode=true. Is it possible that the
control while in design mode is not allowing focus to pass through, and if
so, do you have any suggestions for how to handle the problem?
Private Sub RedrawControls()
Dim ControlHeight As Integer = txtField.Height
If Me.ClientRectangle.Height <> txtField.Height Then
Me.SetClientSizeCore(Me.ClientRectangle.Width, txtField.Height)
Exit Sub
End If
If lblPrompt.Visible = True Then
txtField.SetBounds(lblPrompt.Width, 0, Me.ClientRectangle.Width -
lblPrompt.Width, lblPrompt.Height)
Else
txtField.SetBounds(0, 0, Me.ClientRectangle.Width,
lblPrompt.Height)
End If
If Me.DesignMode = True Then
Splitter1.Enabled = True
Debug.WriteLine(Splitter1.Enabled)
Else
Splitter1.Enabled = False
End If
End Sub
""Jeffrey Tan[MSFT]"" <v-jetan@online.microsoft.com> wrote in message
news:CtqQsmrsFHA.2956@TK2MSFTNGXA01.phx.gbl...[color=blue]
> Hi,
>
> Thanks for your post.
>
> Based on my understanding, your application implemented the IDesignHost
> and
> other interfaces to introduce design-time support for hosting custom
> controls.
>
> Currently, I am not sure I understand your problem very well. It seems
> that
> your program logic below is correct:
>
> Private Sub Initialize()
> If Me.DesignMode = True Then
> Splitter1.Enabled = True
> Else
> Splitter1.Enabled = False
> End If
> End Sub
>
> Do you mean that Me.DesignMode sometimes reports the wrong state? More
> specificly, sometimes Me.DesignMode reports false in design-time, yes?
>
> If we use Reflector to view Component.DesignMode, we will see:
> [DesignerSerializationVisibility(DesignerSerializat ionVisibility.Hidden),
> Browsable(false)]
> protected bool DesignMode
> {
> get
> {
> ISite site1 = this.site;
> if (site1 != null)
> {
> return site1.DesignMode;
> }
> return false;
> }
> }
>
> So, Component.DesignMode just query the internal ISite and return its
> DesignMode property. However, if site is not created, it will just report
> false. For more information, please refer to the link below:
> "Bug Details: DesignMode variable does not appear to work as expected"
>
http://lab.msdn.microsoft.com/Produc...x?feedbackid=d
> 6ad5162-9693-49cc-abc0-659111823582
>
> 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.
>[/color]