Click here to Skip to main content
15,914,074 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I have added a user control to my VB6 project. This user control is also the startup for my project. Now I have some methods in the user control which I would like to be access from the modules.

Is there a way to access the methods of a user control from a module?

I tried :

//Name of user control is ConfigMgr

//The following code is in the Module
Public Function CalVa()

Dim cfgmgr

Set cfgmgr = new Configmgr //Error


End Function


The error is it says that "User-defined type not defined"

I am not sure where I am wrong. If someone could please help me solve this problem, it will be great.

--
AJ
Posted
Comments
Christian Graus 1-Jul-11 4:40am    
VB6 is rubbish, out dated, unsupported, obsolete and not used anywhere worth being. As you're learning, why not learn a real language?
Nagy Vilmos 1-Jul-11 8:33am    
That's a fair point, unbiasedly made ;)

1 solution

User controls are normally added to a form, or another user control, at design time. AFAIK at runtime it needs to be on a form to be instantiated.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900