dotnet windows forms designtime:
Can you not in some way put the AddHandler before the InitializeComponent call? [quoted text, click to view] "Marina" wrote: > Hi, > > I have a component that implements ISupportInitialize, so the code in > InitializeComponent is something like: > > theComponent.BeginInit() > > ' Set theComponent properties > > theComponent.EndInit() > > Now, EndInit, needs to raise an event, such that the end developer can > handle it, and perform some other code to be done to the component, before > EndInit actually finishes it's work. > > Now, the problem is that VB, uses the Handles clause to define event > handlers in the designer. The problem of course, is that this Handles, > doesn't hook up the event until InitializeComponent finishes - at which > point EndInit has been called, and the event fired and it is too late. > > Now, in C#, the event handler is hooked up programmatically, and the > designer generates explicit code for this in InitializeComponent - so it > would work there. > > Given that this is VB, is there any way to get the designer to generate > AddHandler code? > > Any other workaround suggested? > >
Hi, I have a component that implements ISupportInitialize, so the code in InitializeComponent is something like: theComponent.BeginInit() ' Set theComponent properties theComponent.EndInit() Now, EndInit, needs to raise an event, such that the end developer can handle it, and perform some other code to be done to the component, before EndInit actually finishes it's work. Now, the problem is that VB, uses the Handles clause to define event handlers in the designer. The problem of course, is that this Handles, doesn't hook up the event until InitializeComponent finishes - at which point EndInit has been called, and the event fired and it is too late. Now, in C#, the event handler is hooked up programmatically, and the designer generates explicit code for this in InitializeComponent - so it would work there. Given that this is VB, is there any way to get the designer to generate AddHandler code? Any other workaround suggested?
The point is I want it to be generated somehow by the designer. This is a component that end developers will use - and they shouldn't be going in to do this by hand. Like I said, if this was C#, this would not be an issue. But how can this be done in VB? [quoted text, click to view] "Bonj" <Bonj@discussions.microsoft.com> wrote in message news:B91B07E8-350D-471A-92A4-34580025B8CA@microsoft.com... > Can you not in some way put the AddHandler before the InitializeComponent call? > > > "Marina" wrote: > > > Hi, > > > > I have a component that implements ISupportInitialize, so the code in > > InitializeComponent is something like: > > > > theComponent.BeginInit() > > > > ' Set theComponent properties > > > > theComponent.EndInit() > > > > Now, EndInit, needs to raise an event, such that the end developer can > > handle it, and perform some other code to be done to the component, before > > EndInit actually finishes it's work. > > > > Now, the problem is that VB, uses the Handles clause to define event > > handlers in the designer. The problem of course, is that this Handles, > > doesn't hook up the event until InitializeComponent finishes - at which > > point EndInit has been called, and the event fired and it is too late. > > > > Now, in C#, the event handler is hooked up programmatically, and the > > designer generates explicit code for this in InitializeComponent - so it > > would work there. > > > > Given that this is VB, is there any way to get the designer to generate > > AddHandler code? > > > > Any other workaround suggested? > > > > > >
I have no idea how to use them. Any links to tutorials? [quoted text, click to view] "Joey Callisay" <hcalisay@codex-systems.com> wrote in message news:Ox3M1%23zrEHA.1692@TK2MSFTNGP10.phx.gbl... > have you tried using custom serializers? > > "Marina" <someone@nospam.com> wrote in message > news:uBEowJWrEHA.3520@TK2MSFTNGP11.phx.gbl... > > The point is I want it to be generated somehow by the designer. This is a > > component that end developers will use - and they shouldn't be going in to > > do this by hand. > > > > Like I said, if this was C#, this would not be an issue. But how can this > be > > done in VB? > > > > "Bonj" <Bonj@discussions.microsoft.com> wrote in message > > news:B91B07E8-350D-471A-92A4-34580025B8CA@microsoft.com... > > > Can you not in some way put the AddHandler before the > InitializeComponent > > call? > > > > > > > > > "Marina" wrote: > > > > > > > Hi, > > > > > > > > I have a component that implements ISupportInitialize, so the code in > > > > InitializeComponent is something like: > > > > > > > > theComponent.BeginInit() > > > > > > > > ' Set theComponent properties > > > > > > > > theComponent.EndInit() > > > > > > > > Now, EndInit, needs to raise an event, such that the end developer can > > > > handle it, and perform some other code to be done to the component, > > before > > > > EndInit actually finishes it's work. > > > > > > > > Now, the problem is that VB, uses the Handles clause to define event > > > > handlers in the designer. The problem of course, is that this > Handles, > > > > doesn't hook up the event until InitializeComponent finishes - at > which > > > > point EndInit has been called, and the event fired and it is too late. > > > > > > > > Now, in C#, the event handler is hooked up programmatically, and the > > > > designer generates explicit code for this in InitializeComponent - so > it > > > > would work there. > > > > > > > > Given that this is VB, is there any way to get the designer to > generate > > > > AddHandler code? > > > > > > > > Any other workaround suggested? > > > > > > > > > > > > > > > > > >
have you tried using custom serializers? [quoted text, click to view] "Marina" <someone@nospam.com> wrote in message news:uBEowJWrEHA.3520@TK2MSFTNGP11.phx.gbl... > The point is I want it to be generated somehow by the designer. This is a > component that end developers will use - and they shouldn't be going in to > do this by hand. > > Like I said, if this was C#, this would not be an issue. But how can this be > done in VB? > > "Bonj" <Bonj@discussions.microsoft.com> wrote in message > news:B91B07E8-350D-471A-92A4-34580025B8CA@microsoft.com... > > Can you not in some way put the AddHandler before the InitializeComponent > call? > > > > > > "Marina" wrote: > > > > > Hi, > > > > > > I have a component that implements ISupportInitialize, so the code in > > > InitializeComponent is something like: > > > > > > theComponent.BeginInit() > > > > > > ' Set theComponent properties > > > > > > theComponent.EndInit() > > > > > > Now, EndInit, needs to raise an event, such that the end developer can > > > handle it, and perform some other code to be done to the component, > before > > > EndInit actually finishes it's work. > > > > > > Now, the problem is that VB, uses the Handles clause to define event > > > handlers in the designer. The problem of course, is that this Handles, > > > doesn't hook up the event until InitializeComponent finishes - at which > > > point EndInit has been called, and the event fired and it is too late. > > > > > > Now, in C#, the event handler is hooked up programmatically, and the > > > designer generates explicit code for this in InitializeComponent - so it > > > would work there. > > > > > > Given that this is VB, is there any way to get the designer to generate > > > AddHandler code? > > > > > > Any other workaround suggested? > > > > > > > > > > >
have you browsed through Burke's sample at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/custcodegen.asp just to give you a start... [quoted text, click to view] "Marina" <someone@nospam.com> wrote in message news:enTB9q5rEHA.2596@TK2MSFTNGP12.phx.gbl... > I have no idea how to use them. Any links to tutorials? > > "Joey Callisay" <hcalisay@codex-systems.com> wrote in message > news:Ox3M1%23zrEHA.1692@TK2MSFTNGP10.phx.gbl... > > have you tried using custom serializers? > > > > "Marina" <someone@nospam.com> wrote in message > > news:uBEowJWrEHA.3520@TK2MSFTNGP11.phx.gbl... > > > The point is I want it to be generated somehow by the designer. This is > a > > > component that end developers will use - and they shouldn't be going in > to > > > do this by hand. > > > > > > Like I said, if this was C#, this would not be an issue. But how can > this > > be > > > done in VB? > > > > > > "Bonj" <Bonj@discussions.microsoft.com> wrote in message > > > news:B91B07E8-350D-471A-92A4-34580025B8CA@microsoft.com... > > > > Can you not in some way put the AddHandler before the > > InitializeComponent > > > call? > > > > > > > > > > > > "Marina" wrote: > > > > > > > > > Hi, > > > > > > > > > > I have a component that implements ISupportInitialize, so the code > in > > > > > InitializeComponent is something like: > > > > > > > > > > theComponent.BeginInit() > > > > > > > > > > ' Set theComponent properties > > > > > > > > > > theComponent.EndInit() > > > > > > > > > > Now, EndInit, needs to raise an event, such that the end developer > can > > > > > handle it, and perform some other code to be done to the component, > > > before > > > > > EndInit actually finishes it's work. > > > > > > > > > > Now, the problem is that VB, uses the Handles clause to define event > > > > > handlers in the designer. The problem of course, is that this > > Handles, > > > > > doesn't hook up the event until InitializeComponent finishes - at > > which > > > > > point EndInit has been called, and the event fired and it is too > late. > > > > > > > > > > Now, in C#, the event handler is hooked up programmatically, and the > > > > > designer generates explicit code for this in InitializeComponent - > so > > it > > > > > would work there. > > > > > > > > > > Given that this is VB, is there any way to get the designer to > > generate > > > > > AddHandler code? > > > > > > > > > > Any other workaround suggested? > > > > > > > > > > > > > > > > > > > > > > > > > > >
Don't see what you're looking for? Try a search.
|