How to get date value form one form to another form using C# in Window Application

Create a constructor on form2 with input parameter as date time. And when you create object of form2 in form1 just pass the date value using C# in window application.

form1 coding:
            DateTime objdate = dateTimePicker1.Value;
            form2 objform2= new form2(objdate)
            objform2.show();

Form2 coding:
        DateTime  dateen;	
	// Constructor
        public form2(DateTime str)
        {
            dateen = str;
        }
This entry was posted in General and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *