I'm using a activex dll. Is there anyway to edit controls in my exe with a sub inside the dll's class? Like setting a textboxes text value?
Printable View
I'm using a activex dll. Is there anyway to edit controls in my exe with a sub inside the dll's class? Like setting a textboxes text value?
You could pass the textbox as an object or textbox to that sub.
Code:Sub yoursub(tb As TextBox)
With tb
.text = "this textbox is being edited by the Dll"
.BackColor = vbRed
...
End With
End Sub
Actually i figured that out by trial and error about 10 min aog =)
Will that work with whatever object I send it, as in if ISo the following would ask for the string and set the txtBox value on my form to the string value? Would that work?Code:clsClass.Test txtBox
Sub Test(tb as Textbox)
Dim StrText as string
strText = inputbox("Enter the String")
tb.text = strText
End Sub
That will only work for textboxes, although all of them :) I'm not sure that was what you wanted, anyway if you want to pass otheritems with text property you could change as Textbox to As Object
Thanks Kedaman, id thank you in icq but im at work =)
Unfortunately Kedaman, that doesn't work in a Public statement, as in the only statements my program can call. Is there a work around for this???
public statement? What do you mean by that?
I meant for example:
unfortunately you cannot do something like txt as textbox in a public sub of the DLL's Class. Any ideas??Code:Public sub Test(txt as textbox)
end sub
Code:Public Sub Test(txt As Object)
If TypeOf txt Is TextBox Then 'Do code here
End Sub
hey!! HEhe this happens usually when you post same qwestion at multiple threads, well just check out your other one, should solve your probs