You should be able to manipulate objects on a form from within a class by prefixing the object name with the form name. I have done this many times before. If you use the auto complete stuff, all the objects available should be in that list.
Quros is still right. You can also pass the form as a parameter.
Code this inside your class:
-----------------------------------------------------
Public sub ChangeFormCaption (TheForm as form)
TheForm.Caption = "Hello."
end sub
-----------------------------------------------------
And use it like this in your exe:
----------------------------------------------------
Mydll.ChangeFormCaption Me
----------------------------------------------------
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
Hmmm then you have to explain what you mean by 'EXE-form' - I've just tested a dll that plot a world map on a form in a vb project (.vbp or .exe).
The class looks like this:
-------------------------------------------------
Public Property Let PlotOnForm(TheForm)
Set PlotOn = TheForm
End Property
-------------------------------------------------
-and it works fine.
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
first thank you for your support
My project looks like this:
1) I have a projectGroup names FundResearch.vbg , this contain 2 projects
1.1 Fundus.vbp (with forms) and
1.2 FundVolumen.vbp (with class -> dll)
So, I would like to change settings from forms in fundus.vbp
Tanks
Code like this in your class (FundVolumen)
-------------------------------------------------
Dim OpForm as form
Public Property Let ChangeOnForm(TheForm)
Set OpForm = TheForm
End Property
public sub ChangeCaption(Caption as string)
Set OpForm.Caption = Caption
end sub
-------------------------------------------------
And then in your vb project (Fundus):
--------------------------------------------------
Dim Test as new FundVolumen
FundVolumen.ChangeOnForm = Me 'Me is synonym for the current form
Fundvolumen.ChangeCaption("Er du dansk?"
--------------------------------------------------
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.