awu25
asked on
C# Calling a method in another form
I have two windows forms, FormPurchaseHistory and FormCustomer. FormPurchaseHistory opens up FormCustomer which displays a list of Customers in a DataGridView control. User clicks on a cell to select a customer and FormCustomer passes the CustomerID to FormPurchaseHistory and FormCustomer closes. There is a method in FormPurchaseHistoy I need to call after FormCustomer passes CustomerID to FormPurchaseHistory to retrieve purchase history by the customer. How do I fire that method?
I am using a static variable in a Module to pass value from FormCustomer to FormPurchaseHistory.
I am using a static variable in a Module to pass value from FormCustomer to FormPurchaseHistory.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would make the selected CustomerID a Public Property of FormCustomer . I would also show FormCustomer as a MODAL form, and when the form is closed, read the CustomerID property, and then use that value to retrieve the Customer History for the Selected customer.
AW