So i am taking another approach to the situation. If I have a method in a Window how would i use that method in another class? Ive tried referencing that class by simply calling it: example is wdwMain.MethodIWant. I have also tried making a property that is an instance of that window and tried calling the method that way: example is Dim MainWin As New wdwMain … MainWin.MethodIWant. Does anyone have another way that i could use to call a nested method?
If you have a method that is not private to the window but is called from other windows and places etc too then it shouldn’t be in the window in the first place but should be in a module, possibly with global scope.
Or if the method is applicable to other, like windows, create a Window subclass, put the method in there, then make your windows a member of that subclass.
To do that, add a new class, not window, set its super to “Window” and add your method(s). Then set the super of the windows to that class. You can also implement events to make all of your windows behave the same way.
So i am taking another approach to the situation. If I have a method in a Window how would i use that method in another class? Ive tried referencing that class by simply calling it: example is wdwMain.MethodIWant. I have also tried making a property that is an instance of that window and tried calling the method that way: example is Dim MainWin As New wdwMain … MainWin.MethodIWant. Does anyone have another way that i could use to call a nested method?[/quote]
A lot of us use methods in other windows daily.
Probably the reason you did not get any reply is because there was nothing to guess with the little available. Without code, impossible to work. If you were so kind to post a sample project showing the issue, it would be whole lot easier to see what your issue is in the post you made last week.
Since apparently the method works when it is on the same window, it looks as it is a question of variables scope. But it is impossible to help without any code or anything to work on.
I think you should definitely forget using methods scattered on different windows, and as advised by Albin and Markus before me, place all the methods you want to share in a module. In doing so, you may even find out why it did not work before.
you guys were all right and also wrong with what i needed. I began creating a class that was of the super type window and as i was testing the two methods i was working with a realized that the properties i was referring to was not the same across the code. so i started references specific properties instead of creating new instances through the new classes with the same name. this solved my problem. My apologies to Michael Bujardet, had you have been able to see my code im sure you would have found that issue.