felipe Posted November 13, 2003 Posted November 13, 2003 is it possible to dynamicly create a control, such as a pictureBox, within a class method and then add it to a form without the form knowing about it? Quote
*Gurus* divil Posted November 13, 2003 *Gurus* Posted November 13, 2003 The form will always know about it, because you're going to be adding it to the form's Controls collection. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
felipe Posted November 13, 2003 Author Posted November 13, 2003 thanks for the reply divil, well this is what i am trying to do: - in xForm_Load i call a method to initialize components. - Initialize() creates an instance of xClass - xClass then creates xControl and adds it to xForm Problem: - i have tried to use ActiveForm.Controls.Add(xControl) but since the for m load procedure is not complete, the form isnt active. - I've tried force the form to activate early but it doesnt work Question: how can i add xControl to xForm during xForm_Load? what type of syntax would i have to use? Quote
*Gurus* divil Posted November 14, 2003 *Gurus* Posted November 14, 2003 Just pass the form to the method that's going to add the controls. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.