Pass an Object (a Form) as a parameter to an OCX: possible 
Author Message
 Pass an Object (a Form) as a parameter to an OCX: possible

I would like to pass an object (a Form) as a parameter to an OCX I am trying to write.

Apparently, VB  does not like at all my
Public Sub XXXXX(frm as Form, ....)

Is there a workaround ?

I would like to collect quite a few informations on that form:
  Icon, Picture
  Left Top Width Height

and perform a few mistreatments
  Enable / disable / hide it....



Wed, 25 Jul 2001 03:00:00 GMT  
 Pass an Object (a Form) as a parameter to an OCX: possible
Pass your for object as an object not a form.

Public Sub MySub(FRM as Object)

    MsgBox FRM.Caption

End Sub

-Shahram Shapouri

Quote:

>I would like to pass an object (a Form) as a parameter to an OCX I am
trying to write.

>Apparently, VB  does not like at all my
>Public Sub XXXXX(frm as Form, ....)

>Is there a workaround ?

>I would like to collect quite a few informations on that form:
>  Icon, Picture
>  Left Top Width Height

>and perform a few mistreatments
>  Enable / disable / hide it....



Wed, 25 Jul 2001 03:00:00 GMT  
 Pass an Object (a Form) as a parameter to an OCX: possible
One workaround is to create a property for the value ie;

Dim moForm as Form

Public Property Set TheForm(oForm as Form)
    Set moForm = oForm
End Property

Public Sub XXXXXX(....)

    'You can use the module level value moForm here.
    moForm.Show

End Sub

You just need one extra line of code before you call the XXXXX procedure to
set the TheForm property.



Thu, 26 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Passing Parameters to Form Object in VB6

2. Use a form object passed as a parameter

3. Pass Parameter from form to form

4. How can I pass parameter from a form to another form

5. passing parameters from html to ocx

6. Passing Byref parameter to an ocx method

7. passing parameters to ocx control

8. passing parameters to OCX

9. Passing a parameter value using OCX

10. Passing Parameters to Crystal OCX

11. Passing parameter from Crystal OCX to a report that uses a stored procedure

12. Passing parameters via CR6 ocx -- kill prompt

 

 
Powered by phpBB® Forum Software