-
I have a project with 3 forms. I can not figure out how to declare statements in one place that all 3 forms can use. Example: I have to place
Private Declare Function GetFocus& Lib "user32" ()
in all three forms in order to use this. I know there is a way to create one module and have all forms reference it? How
-
There are two things you can do. Change your declaration to Public and place it in any one of your forms' Declarations section, or
(better) add a module to your project and place the Public declaration there.
------------------
Marty
-
Select Project --> Add Module
from the menu and declare the function Public (instead of Private)
-
Add the declaration to a BAS module and declare it as Public instead of Private:
Public Declare Function GetFocusLib "user32" () As Long
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
-
Marty you can't put Public Keyword in Form's Declarations Section. It causes an error!!!
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.
-
If you're declaring APIs or User Defined Data Types on the form level, then you must declare those as private only.
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 11-09-1999).]
-
Actually you can.
Code:
Public MyVariable As String
Public Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hwnd As Long, ByVal lpHelpFile As String, ByVal wCommand As Long, ByVal dwData As Long) As Long
The first statement is OK. The second one isn't.
------------------
Marty
-
Sorry Martin, my mistake about variables.
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.