Mini556976

How would i make it so my form_add.vb when I press the ok button will take its textboxe: textbox1.Text and put it in form_main.vb's rtb1.Text

Thnx in advance



Re: Visual Basic Express Edition Variables used by 2 forms or more

DMan1

Use events and event handlers...see my answer in this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1239834&SiteID=1






Re: Visual Basic Express Edition Variables used by 2 forms or more

BadButBit

you can access the content of a text box on a separate form by calling it by its full name ... in your example the subroutine in form_Add and use a line like form_main.rtb1.text = "whatever you want it to be"

also... along the same lines ... you can declare functions, subroutines, and global variables as Public (use the word 'public' instead of 'Dim') and you can say.. form_main.gloMyGlobalVariable = 24 from any other form

hope that helps





Re: Visual Basic Express Edition Variables used by 2 forms or more

DMan1

BadButBit wrote:

you can access the content of a text box on a separate form by calling it by its full name ... in your example the subroutine in form_Add and use a line like form_main.rtb1.text = "whatever you want it to be"

also... along the same lines ... you can declare functions, subroutines, and global variables as Public (use the word 'public' instead of 'Dim') and you can say.. form_main.gloMyGlobalVariable = 24 from any other form

hope that helps

Two issues with your respone:

1. You must have the proper instance name inorder to reference an object

2. Unless you utilize an event, the update of the remote variable will have to take place manually