Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding User Control?

Status
Not open for further replies.

Bewilderec

Programmer
Jun 25, 2003
4
0
0
US
I've written a program that needs to be converted from an .exe file to an .ocx file. When I run the program as an Active X control, I get the html page; but I can't read in my input variables.

For intNum = 0 To 4
If (frmVTI.txt(intNum).Text = "") Then
frmVTI.Refresh
frmVTI.txt(intNum).SetFocus
InfoMsg = MsgBox("Error: Check Values", vbCritical, "Error")
ChkErrors = 1
Exit Function
End If
Next intNum

I've tried changing the frmVTI object to UserControl object but no success. I also get an error at .SetFocus.

thanks in advance
 
can u be a bit more clear?

Known is handfull, Unknown is worldfull
 
In the .exe format, I was reading in values from the form. These values were were in an array, txt(intNum). So I used frmVTI.txt(intNum).xxxxxx to evaluate. When I tried converting it to .ocx, I did an "add User Control." After I added the usercontrol, I copied and pasted my form(frmVTI) to my control(UserControl1). So, how do I read my values, frmVTI.txt(intNUM), when I'm trying to read them from a user control? Probably a better question is.......how do you convert .exe to .ocx?
 
txt(intNum).xxxxx must work if the form has been converted to a usercntrol.

Known is handfull, Unknown is worldfull
 
vbkris,
thanks for the help. My functions within my module couldn't read in the values. I am sure there is a way to use modules with user controls, but I just copied and pasted all of my functions to the user control. It worked!

thanks again,
Bewilderec
 
User Controls are self contained. They have no way of hooking back to you applications code directly. Thus a UserControl should either have all the logic it needs to function withing the controls library or it can reference other libraries for that code. But as far as things like standard modules it Custom Controls can't see another projects code in standard modules. You can hack it but you'd be causing more greef then it is worth.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top