Actually, I added static member function for BaseForm which is inherited
from System::Windows::Forms::Form.
And all other forms are inherited from the BaseForm.
Then I can type following code when I need the function.
utility_function(...);
But if I create a specific utility class like
public ref class Utils {
....
public: int utility_function();
....
};
Whenever I try to use the funtion, I have to write the following code.
Utils utils; (or Utils^ utils = gcnew Utils();)
utils->utility_function();
I think this is not cute code. ;-P
Sorry.
I'm a quite newbie in VC.NET so I think I can be missing some other way.
Please give me one more comment on this.
I have a lot of forms for my project, so I think it's also not cute that
I have to
change all base forms.
ad******@club-internet.fr wrote:
Eddie wrote:
Ok, I got it.
Inheritance is a good choice here.
No, I don' think so. Better put your utility function as a static
member function in an "Utils" (name it the way you want) class.
Arnaud
MVP - VC