Click to See Complete Forum and Search --> : simple one about 2 forms


ilk
November 26th, 2002, 07:19 AM
Hi all,

Just trying to learn VB.net. I've got a simple activex control on a form. that form opens another form which is meant to gather the information and pass it to the parent activex. my msdn or sdk docs didn't install properly so i cannot access any help(some scratches on the disks) .

question no 1:
ActiveX control. how do i hide all the default properties from parent app when i use it. Say I've got a custom textbox and I want to be able to see only text.text and a custom method text.save and none of the original textbox properties.

question no 2:
when I try to pass an info from the second form to the control it gives me object referrence error or it does not pass the info back
if i use the following on button click event in the second form

dim frm as new form
set frm = form1 ' reference to the first form
frm.cusCTRL1.Text = textbox1.text ' doesnot seem to be able to pass the info
me.close



Thenk you v m

Athley
November 26th, 2002, 08:17 AM
Answer to Question2:

Rewrite the Sub New for the second form to take an argument as a form. Then pass the first form to the second form when you create the instance.

You can also create your own Forms collection for the application:

Forms collection (http://www.fawcette.com/vsm/2002_12/online/hottips/lobel/)

/Leyan