|
-
Feb 6th, 2005, 11:19 PM
#1
Passing Control Name to UserControl [Resolved]
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.
Last edited by Danial; Feb 7th, 2005 at 12:19 AM.
Reason: Reslolved
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Feb 7th, 2005, 12:18 AM
#2
Re: Passing Control Name to UserControl
Never mind I resolved it, I was calling it like myFunc(txtUsername) instead of myFunc txtUsername or Call myFunc(txtUsername). That was the problem.
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Feb 7th, 2005, 12:19 AM
#3
Re: Passing Control Name to UserControl
Cool. I was looking for a resolution.
-
Feb 7th, 2005, 12:25 AM
#4
Re: Passing Control Name to UserControl
 Originally Posted by dglienna
Cool. I was looking for a resolution.
Thanks for trying. Its wired, the compiler should have flagged it. If I have those bracket it passes the parameter as string otherwise passes it as Control.
Another reason why I have moved on to C#
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|