View Single Post
  #10 (permalink)  
Old September 14th, 2004, 09:17 AM
MKri MKri is offline
Authorized User
Join Date: Jun 2004
Location: Karlovac, , Croatia.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for your answer, but I'm not sure I understand it. Can you please apply it on my specific problem:

I have forms frm1, frm2 ... frm20. They are opened one at a time.
All of them have 4 text boxes: txt1, txt2, txt3 and txt4.
All of the forms have a procedure proc() which does the following:

txt1.Text = "a"
txt2.Text = "b"
txt3.Text = "c"
txt4.Text = "d"

Now I want to avoid having that procedure in each one of the 20 forms. I want to have it only once and it would probably be in a
separate module.
So, I need an opened form to be able to call that procedure in that
module and get it's text boxes filled with "a", "b", "c" and "d".

In VBA you would simply put procedure

Sub proc()
CodeContextObject.txt1 = "a"
CodeContextObject.txt2 = "b"
CodeContextObject.txt3 = "c"
CodeContextObject.txt4 = "d"
End Sub

in a separate module and call it from any of the forms:

Sub btn1_Click()
Call proc
End Sub

and the text boxes would get their values.

So, how to do it in VB.NET?

Thanks in advance.

Reply With Quote