Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Event for .net control similar foxpro object Init() even
Message
From
29/10/2009 11:23:11
 
 
To
29/10/2009 11:00:53
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01432201
Message ID:
01432206
Views:
43
>>Hi,
>>My question maybe is stupid :)) but I can't find event for control like FoxPro object Init event :)) sorry..
>>
>>I try to explain.
>>I wrote some code into baseclass of control. This code must be executed when control initialized.. and ONLY in RUNTIME.. not at design time
>>
>>So.. if I put code to Sub New() - this code always executed in runtime and designtime because DesignMode for control inside Sub New() is always false. (even if I open it in IDE)
>>So I need to find possiblity to start a code when control initializing and only in DesignMode = false
>>
>>Thanks for help
>>Denis
>
>
>Denis,
>
>Never needed to - but I may in the future
>
>Does this help ?
>
>
>http://msdn.microsoft.com/en-us/library/bb514560.aspx
>
>
>http://msdn.microsoft.com/en-us/library/system.componentmodel.designerproperties_members.aspx


Hi,
I found the ComponentModel.DesignerProperties - DesignerProperties is not a member of componentModel namespace..(I use also 3.5) Maybe its only for WPF ?


But... now I thinking a little bit more... and maybe its wrong to use DesignMode in Sub New() - because.. normally.. as I think.. control must call internal control code when Form.Initializecomponent() is done.. (but control.new() happes when properties is not setted up)

I just thinking..
When I put my control on the form in designTime - I need no control reaction.
When I start my form.. form running Form.New() and inside make initializecomponents -
And inside form.initializecomponents - normally my control properties getting new values...
And after this I want - my control execute some method of Itranslatable interface and translate label to another language - depends from properties defined in design time.

So.. on my opinion - I must after form.initilizecomponent go through each control.. check if this control has ITranslatable interface.. and then invoke method to translate...
Or.. maybe control can listen some event.. which happens after initializecomponent is done... and then.. execute internal function of ITranslatable interface.

In first case - I need to program special control holder form ... in second.. I can place controls to any form to get this behaviour.. So.. I want second way.. to control invoke self method after form.initializecomponent is done...

Thank you
Denis
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform