Hi all,

Can a user control be written in such a way that it can behave differently
depending on whether it is being authored, being used on a form in VS2003 and
being used at runtime? If so, how does it tell the difference between these
environments?

I am developing a user control based on the ListView control that will
display a subset of the application event log, given a named event source.

In order to make the control show event log data in design-mode as well as
at run-time, I altered the constructor so that it would populate the ListView.

To avoid unwanted delay, the function that populates the ListView runs in
its own thread. Despite this, there is a significant delay when I switch from
code-view to design-view in a WinfForms app that uses this component, during
development. It takes about 15 seconds to switch views.

Is there anything I can do to avoid this. I am trying to deisgn the control
so that it looks the same at design time as it does at run-time.

Regards,
Ian.

Re: UserControl behaviour at author-time design-time and run-time by Mike

Mike
Wed Oct 20 11:18:31 CDT 2004

You may find this article helpful:
http://www.dotnet247.com/247reference/msgs/55/278157.aspx



--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Ian Taite" <Ian Taite@discussions.microsoft.com> wrote in message
news:336546A4-598C-447F-9555-86F5E3EDA833@microsoft.com...
> Hi all,
>
> Can a user control be written in such a way that it can behave differently
> depending on whether it is being authored, being used on a form in VS2003
> and
> being used at runtime? If so, how does it tell the difference between
> these
> environments?
>
> I am developing a user control based on the ListView control that will
> display a subset of the application event log, given a named event source.
>
> In order to make the control show event log data in design-mode as well as
> at run-time, I altered the constructor so that it would populate the
> ListView.
>
> To avoid unwanted delay, the function that populates the ListView runs in
> its own thread. Despite this, there is a significant delay when I switch
> from
> code-view to design-view in a WinfForms app that uses this component,
> during
> development. It takes about 15 seconds to switch views.
>
> Is there anything I can do to avoid this. I am trying to deisgn the
> control
> so that it looks the same at design time as it does at run-time.
>
> Regards,
> Ian.