Hi, declare a common class to hold common information which are needed in the lifetime of an application, it is the convenient way to store and access common information. Create a Class named
CommonInfo like below, and create a string property named
DateTimeInfo to hold DateTime information.
public static class CommonInfo
{
private static string _DateTimeInfo = string.Empty;
public static string DateTimeInfo
{
get { return _DateTimeInfo; }
set { _DateTimeInfo = Value; }
}
}
Now you can store and access information to DateTimeInfo from anywhere inside your project. Assign the DateTime information to
CommonInfo.DateTimeInfo property when you load the main form. In the Load event of Main form assign DateTime information like this,
CommonInfo.DateTimeInfo = your expression;
Now you can get this from your tab pages. For that just use
CommonInfo.DateTimeInfo.