Using system;
Using system.collections;
Using system.componentmodel;
Using system.drawing;
Using system.data;
Using system.windows.forms;
Namespace XPANGLIB
{
///
/// DateInput's summary description.
/// summary>
Public class dateinput: system.windows.forms.userControl
{
#Region member control
Private system.windows.Forms.Montcalendar Calendar;
Private system.windows.forms.form frmcalendar;
Private system.windows.forms.Panel Panel3;
Private system.windows.Forms.Button Btnmain;
Private system.windows.Forms.vscrollbar Updown;
Private system.windows.Forms.Panel Panel1;
Private system.windows.Forms.Panel Panel2;
Private system.windows.Forms.Label lbsep3;
Private system.windows.Forms.TextBox TBDAY;
Private system.windows.forms.label lbsep2;
Private system.windows.Forms.TextBox TBMOSTH;
Private system.windows.forms.label lbsep1;
Private system.windows.Forms.TextBox Tbyear;
Private system.windows.Forms.Label label2;
Private system.windows.Forms.Label lbspace;
#ndregion
///
/// The required designer variable.
/// summary>
Private system.componentmodel.Container Components = NULL;
Private contextmenu mnu = new contextmenu ();
#Region Custom Attribute
[Browsable (True), Readonly (False)]
Public Size Size
{
set
{
Base.size = New size (Value.width, 21);
This.SetBounds (base.location.x, base.location.y, this.width, base.height);
THIS.REFRESH ();
}
get
{
Return Base.size;
}
}
Private string strdateFormat;
[CategoryAttribute ("Display Properties and Values",
TypeConvertRibute (TypeOf (DateFormatconverter),
DescriptionAttribute ("Time Display Format"),
ReadonlyAttribute (FALSE)]
Public String DateFormat
{
get
{
Return strdateFormat;
}
set
{
STRDATEFORMAT = Value;
RefreshDisplay ();
}
}
PRIVATE STRFOMATCHAR;
[CategoryAttribute ("Display Properties and Values",
DescriptionAttribute ("Custom Display Format"),
ReadonlyAttribute (FALSE)]
Public String Fomatchar
{
get
{
Return strfomatchar;
}
set
{
Strfomatchar = value;
RefreshDisplay ();
}
}
Bool blshowupdown = false;
[CategoryAttribute ("Display Properties and Values",
DescriptionAttribute ("Show Updown Button"),
ReadonlyAttribute (FALSE)]
Public Bool ShowuPdown
{
get
{
Return blshowupdown;
}
set
{
BLSHOWUPDOWN = Value;
this.btnmain.visible =! value;
This.Updown.visible = value;
}
}
PRIVATE dateTime DTValue;
///
/// selected date
/// summary>
[CategoryAttribute ("Display Properties and Values",
DescriptionAttribute ("Selected Value"),
ReadonlyAttribute (FALSE)]
Public DateTime Value
{
get
{
IF (isnull ())
DTValue = datetime.minvalue;
Else
{
String stringear = tbyear.text;
String strmonth = tbmonth.text;
String strday = tbday.text;
String strdate = strdate = stryear "-" strmonth "-" strday;
DTValue = DateTime.Parse (strdate);
}
Return DTValue;
}
set
{
DTVALUE = VALUE;
IF (dtvalue == datetime.minvalue)
EmptyInput ();
Else
{
Tbyear.text = dtvalue.year.tostring ();
TBMONTH.TEXT = DTVALUE.MONTH.TOSTRING ();
TBDAY.TEXT = DTVALUE.DAY.TOSTRING ();
}
THIS.REFRESH ();
}
}
#ndregion