how to customize the Form class?
-
Hi, I would like to implemnet a process that will initial on every form on my application on form InitializeComponent... My thought is to some how customize the Form class and inherite the new class as my Form i.e. "public class Form1 : MyCustomizedForm" But I don't wont to recreate to whole Form class, I only whant to implement a process on it's loading after all controls were added. But I need it to take place in every form on my application. Any ideas? tnx
-
Hi, I would like to implemnet a process that will initial on every form on my application on form InitializeComponent... My thought is to some how customize the Form class and inherite the new class as my Form i.e. "public class Form1 : MyCustomizedForm" But I don't wont to recreate to whole Form class, I only whant to implement a process on it's loading after all controls were added. But I need it to take place in every form on my application. Any ideas? tnx
So, all you want to do is have something like this:
public class MyCustomizedForm : Form
{
public MyCustomizedForm() : base()
{
// Do some process here. InitializeComponent will already have
// been called by the base constructor.
}
}I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
Hi, I would like to implemnet a process that will initial on every form on my application on form InitializeComponent... My thought is to some how customize the Form class and inherite the new class as my Form i.e. "public class Form1 : MyCustomizedForm" But I don't wont to recreate to whole Form class, I only whant to implement a process on it's loading after all controls were added. But I need it to take place in every form on my application. Any ideas? tnx
I think your talking about creating a class that inherits from system.windows.forms.form. Then in each of your form's designer's change the inheriting from system.windows.forms.form to this new class. Put code in the new class and each form gets that code? if not -> need clarification with what your trying to do.
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous