Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control INIT events??
Message
De
21/01/2009 04:59:09
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
20/01/2009 20:22:54
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01375744
Message ID:
01375823
Vues:
12
Maybe I understand it wrong but looks like you mean the constructor of the panel which is dropped on form where constructor already ran. I would use form's constructor just like form.init in VFP:
        public Form1()
        {
            InitializeComponent();
            foreach (Control oCtrl in this.panel1.Controls)
            {
                // do something
            }
        }
Cetin

>You are right, but I guess I didn't phrase the question properly.
>
>In FoxPro, the INIT event of the form runs after all the controls on the form have been initialized, so you can refer to them in the form's INIT event. But in C# the Controls collection doesn't seem to be available in the constructor. At least in the constructor of a Panel that I have created to hold a bunch of controls.
>
>I need to loop through the controls after they are initialized so that I can set the Bindings on certain objects at runtime. I.e., the TextBoxes, etc.
>
>I used this code to try to accomplish this: (The DataViewPanel is a Panel that contains all of my data controls) I'm using a panel instead of a form so that I can use an expandable splitter. And so I can bring in and out of the main form different panels as they are needed.
>
>public DataViewPanel() //Constructor
>{
> InitializeComponent();
> BindControls();
>}
>
>private void BindControls()
>{
> foreach (Control ctl in this.Controls)
> { //Do something
> }
>}
>
>The BindContols method doesn't see any Controls in the Controls Collection. Can you tell me where I'm going wrong?
>
>Thanks.
>
>bob
>
>
>>>I am transitioning from FoxPro to C# and I need some advice. In FoxPro every control had an INIT event that you could use to initialize values of a control, etc. Such as adding values to a dropdown box, etc.
>>>
>>>What event on C# controls can replace the FoxPro INIT Event?
>>>
>>>Thanks.
>>>
>>>Bob
>>
>>Class constructor typically is the counterpart of init.
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform