[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Working with controls in the multiple forms

hi good day how do i use contols on multiple forms?
0
hariprasadere
Asked:
hariprasadere
  • 2
  • 2
1 Solution
 
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
 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now