You aren't giving us enough code. The likely reason it won't work from a Module is simply scoping. I believe when you say Module, you mean Class. By default Me in a class won't have an MDIParent property. The best way to extend this (assuming you will only have one form), is with a static property on your MDIForm parent class. Something like this:
Sorry code is in C#, but can be adapted appropriately to VB .NET.
public class MyMDIForm : Form { private static MDIForm _current = null; public MyMDIForm() { _current = this; // Set current to the current }
public static MyMDIForm Current { get { return _current; } } }
/* This should be your *module* */ public class WorkerClass { public void DoWork() { MyMDIForm.Current.StatusBar(1).Text = "Something"; } }
|