Here is a problem I am having.
I have a function within a UserControl which takes one parameter (Control)
e.g
VB Code:
public function myFunc(ctrl as Control) end functioin
Now when I place this UserControl in a form and call this function and pass
call myFunc(txtUsername), it gives me Type Mismatch error, now as we know in VB6 the Text is the default property so it is passing the Text instead of the Control itself. Thing is that if I place the same function in the form itself it works fine.
Any Idea how I can pass it as a Control rather then Text?
I know I can probably add a Module and place the code there which might reolve the problem, but I want to have this code in a UserControl.
Thanks in advance.





Reply With Quote