0

Suppose you have a registration form with textboxes to hold a StudentId and a CourseId. Also provided is a button which opens a second form which allows you to lookup a StudentId using by their first or last name.

How return the StudentId from the search form, and load it into the StudentId textbox on the registration form?

Brian Tompsett - 汤莱恩
  • 5,438
  • 68
  • 55
  • 126
odiseh
  • 23,925
  • 32
  • 106
  • 150

1 Answers1

1

I think this answer explains the solution nicely.

Basically, you create a new constructor for your search form which takes a form object as a parameter. When you create call your search form, you pass a reference to the registration form with it.

When the search form finds the studentId, it uses this reference to the registration form to call a public method in the registration form which populates the studentId textbox.

Community
  • 1
  • 1
AgentConundrum
  • 19,890
  • 6
  • 61
  • 99