Link to home
Start Free TrialLog in
Avatar of AdamB_Open
AdamB_Open

asked on

Exposing Constituent Methods to UserControls

I have a usercontrol (VB6.0Ent) containing a graph and wish to let the user access the line method.  The ActiveX Control Interface Manager crashes when I run it for this control, so I wish to know how to do it manually.
Avatar of dhwanilshah
dhwanilshah

'in your controls general section, just add these procedures, I am assuming that the graph's name is graph1

public sub gLine(arg1 as long, arg2 as long)
   graph1.line arg1,arg2
end sub
'i hope u ge the drift from this code
Avatar of AdamB_Open

ASKER

I am sorry.  I was more interested in knowing whether the format could be kept the same.
i.e.   if my usercontrol instance is newGraph1 then

newgraph1.line (x1,y1) - (x2,y2)[,color],[BF]
ASKER CERTIFIED SOLUTION
Avatar of ameba
ameba
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I guess you can do it with having a public method DrawLine (say) which has the same parameters as Line and simply calls the Line method. Nothing else.

Then you can use
NewGraph1.DrawLine (x1,y1) - (x2,y2)[,color],[BF]

hope that helps.
I hate C!
Sorry, I am new.
OK. Thanks