G
Guest
I have two related questions. I have looking in the ide help and have not
been able to find the answers. First, I need to run some initialization code
early in the life of my forms. I have a base class form and my first thought
was to put the code in teh New method after the initialzeComponent call. That
worked fine in run mode but it raised hell with the form designer. It calls
the new method and my bit of code fails because it requies the form to have a
real live Me, with a handle. I tried putting the call inside
if Me.Designmode = false then
MySub(Me.Handle)
end if
but the designer just ignores the if and runs MySub anyway. !st question,
Is there some way to include code that the designer will ignore but will
execute at runtime.
What I mean by this is that if I select a form subclassed from this base
class and select ViewDesigner, I get a screen with a "you're out of luck"
message instead of the form.
Next issue is the sequence of events when a Form is created, for both the
form and its controls. I know the controls load events are raised before the
form's load event but is there a list somewhere with the complete sequence?
The designer also raises the Form's Load event but in that case, if
Me.DesignMode does work as expected so I can just bail if in design mode.
been able to find the answers. First, I need to run some initialization code
early in the life of my forms. I have a base class form and my first thought
was to put the code in teh New method after the initialzeComponent call. That
worked fine in run mode but it raised hell with the form designer. It calls
the new method and my bit of code fails because it requies the form to have a
real live Me, with a handle. I tried putting the call inside
if Me.Designmode = false then
MySub(Me.Handle)
end if
but the designer just ignores the if and runs MySub anyway. !st question,
Is there some way to include code that the designer will ignore but will
execute at runtime.
What I mean by this is that if I select a form subclassed from this base
class and select ViewDesigner, I get a screen with a "you're out of luck"
message instead of the form.
Next issue is the sequence of events when a Form is created, for both the
form and its controls. I know the controls load events are raised before the
form's load event but is there a list somewhere with the complete sequence?
The designer also raises the Form's Load event but in that case, if
Me.DesignMode does work as expected so I can just bail if in design mode.