Pass form object value to static method
- by jrubengb
Hi,
I need to take a form object value and pass it into a static method:
public void SetCalendarStartSafe(DateTime startDateSafe)
{
startDateSafe = calendarStart.Value;
}
private static DataTable GetData()
{
frmMain frm = new frmMain();
DateTime startDate = new frmMain();
frm.SetCalendarStartSafe(startDate);
}
However I keep getting today's current date whenever I try this approach, even if the specified calendar date on the form is different. How can I can the user-specified calendar date from the original frmMain object? Thanks in advance for any guidance.