Working with controls in the multiple forms

hi good day how do i use contols on multiple forms?
hariprasadereAsked:
Who is Participating?
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Show Form B using ShowDialog()...

In Form A:  

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim frmB As New FormB
        frmB.ShowDialog() ' code STOPS here until frmB is CLOSED

        ' grab something from frmB
        TextBox1.Text = frmB.TextBox1.Text

        ' give focus to TextBox1
        TextBox1.Focus()
    End Sub
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
A control can only be located on a single form.   By any chance do you mean MDI forms?
0
 
hariprasadereAuthor Commented:
ok it's not really MDI forms.I have two forms form a and form b .form a is an  items entry screen and form b is a category entry screen.In form a i have a command button where user can click and add category of the items.As soon as the user enter the data in the form b n close the form b,  the  cursor should foucs in the first textbox control of the form a .
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
What language are you working in here?...
0
 
hariprasadereAuthor Commented:
vb.net
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.