|
-
Mar 23rd, 2004, 01:09 PM
#1
Thread Starter
New Member
Sensible form management
I'm trying to find a sensible form management method to allow referencing methods across forms. In brief here's my problem:
Traditionally I've always done this by declaring the form containing the element I want to reference as a local variable at the point of reference. So kind of like this:
Code:
Dim form as frmReference = frmReference.ActiveForm
. Which is great, except this will only work when referencing between two forms where one of the forms called the other. Not exactly useful for any project with >2 forms, and even when it does work it quickly becomes horribly messy.
This started becoming unusable within my current project today, so I tried a different tact. Created a class to hold references to all my forms, whereby each form has a decleration within the class to which they assign themselves when they launch
Code:
clFormLib.frmReference = Me in frmReference_load
Great, a lot neater solution and if a form's open then I can now access it and its properties from anywhere. Except I can't. Because now the compiler refuses to acknowledge that the elements I am trying to reference on these forms exist, because of course the variables which hold the form references aren't assigned to anything before the application is running. So now I can't compile anything!
Can anyone suggest a better form management method to allow me to reference elements through multiple forms within in the application?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|