Can a SmartPart have a Shown event

Topics: CAB & Smart Client Software Factory
Sep 3, 2006 at 8:54 AM
originally posted by: Jrad

A normal Form has Load and Shown events (amongst others) where as a SmartPart is based on UserControl and does not have a Shown Event. Yet when a SmartPart is visible it is a form.

Is there any way of accessing the Shown event.

Sep 4, 2006 at 9:22 PM
originally posted by: askew

You can use the Event Broker to setup events really easily.
The Publisher / Subscriber sides of the Events means you can publish from the UserControl and subscribe from the Shell, for example. You can name as you wish.
Sep 6, 2006 at 7:13 AM
originally posted by: ChrisHolmes

"Yet when a SmartPart is visible it is a form."

It's actually two things: a UserControl and a Workspace :-)

With a regular Form, it is responsible for the controls and events. With a SmartPart, some of the events (specifically those relating to showing/hiding) have been delegated to the Workspace instead. So, any logic you need to create for those purposes should probably reside with the control hosting the Workspace.