talking to forms

  • Thread starter Thread starter Robert Bravery
  • Start date Start date
R

Robert Bravery

HI all,

New to vb.net
I need to know how to talk to a calling form from a called form. I want to
change various properties of the form as well as properties of objects on
that form, Ie pushbuttons texts, label texts etx. I also need to be able to
call som of the objects on the calling forms events, eg to be able to call a
pushbuttons click event on the calling form.
The calling form is not a mdiparent, the called form is not a mdi client,
they are just two seperate forms
form1 opens
pushbutton on form2 creats a object reference to form2
opens form2
on form2 a pushbutton changes text on a label on form one
and then callus a pushbutton click event on form1

In visual dbase I wouild do it like this

'''form1''
set procedure to form2.wfm addi 'load the form in memory
form.ochildform = new form2() 'create a new object in this form
referencing the new form
form.ochildform.parent = form 'reference this form from the other form

pushbutton onclick()
form.ochildform.open() 'open the new form

'''form2''
form.parent.label1.text = "text has changed" 'cjhange the text on the
label of form1
form.parent.pushbutton_onclick() 'call the click event of pushbutton on
form1

Thanks
Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top