-
When creating ActiveX controls with timer events, the timer may start when using it in design time of the VB project, which may cause flicker and other bad stuff.
I need for my control to check if the parent application is in design time or run time.
At the moment I use the Show event of my usercontrol.
I use the :
"parent.ShowInTaskbar = parent.ShowInTaskbar"
and then trap the error, because the ShowInTaskbar property is Read-Only in runtime.
This works OK, but I think there must be a better way telling.
Does anyone know how to do this the "Real" way?
Thx in advance.
Pax
-
Use the UserMode property of the Ambient object of the UserControl, it returns True when in Runtime mode and False when in Designtime mode, i.e.
Code:
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
If UserControl.Ambient.UserMode Then
Label1 = "Runtime"
Else
Label1 = "Design Time"
End If
End Sub
-
Thank's
Thank's alot.
I guess I still have a lot to learn about ActiveX development ;-)
Greetings
Pax