[quoted text, click to view] "Victor Garcia Aprea [MVP]" <vga@NOobiesSPAM.com> wrote in message news:<uVvKqilKEHA.2456@TK2MSFTNGP12.phx.gbl>...
> What about a MaskedTextBox? a... BreadcrumbControl (this one is coming in
> ASP.NET v2, but there is a need for this for the v1.x bits)? A nicer
> Calendar than the built-in one?
>
Here is nicer calendar:
Imports System.ComponentModel
Imports System.Drawing
Imports System.Drawing.Image
Imports System.Drawing.Bitmap
Imports System.Drawing.Imaging.Metafile
<DefaultEvent("SelectedIndexChanged"), _
DefaultProperty("Text"), _
ToolboxData("<{0}:DatePicker id='dp'
runat='server'></{0}:DatePicker>"), _
Designer("Solution.WebControls.Design.DatePickerDesigner")> _
Public Class DatePicker
Inherits Control
Implements INamingContainer
#Region " Members "
Dim m_closeGif As String = "close.gif"
Dim m_dividerGif As String = "divider.gif"
Dim m_drop1Gif As String = "drop1.gif"
Dim m_drop2Gif As String = "drop2.gif"
Dim m_left1Gif As String = "left1.gif"
Dim m_left2Gif As String = "left2.gif"
Dim m_right1Gif As String = "right1.gif"
Dim m_right2Gif As String = "right2.gif"
Dim m_calendar As String = "calendar.bmp"
Dim m_imgDirectory As String = "../../Images/"
Dim m_ControlCssClass As String = ""
Dim m_text As String = ""
Dim m_Css As String = ""
Dim m_DateType As String = "yyyy MMM dd"
#End Region
#Region " Properties "
Public Property Text() As String
Get
EnsureChildControls()
If (Me.Controls.Count = 0) Then
Return ""
End If
Return CType(Controls(1),
System.Web.UI.WebControls.TextBox).Text
End Get
Set(ByVal Value As String)
If Not (Me.Controls.Count = 0) Then
CType(Controls(1),
System.Web.UI.WebControls.TextBox).Text = Value
m_text = ""
Else
m_text = Value
End If
End Set
End Property
Public Property DatePart() As Date
Get
EnsureChildControls()
If (Me.Controls.Count = 0) Then
Return Nothing
End If
Return CDate(CType(Controls(1),
System.Web.UI.WebControls.TextBox).Text)
End Get
Set(ByVal Value As Date)
If Not (Me.Controls.Count = 0) Then
CType(Controls(1),
System.Web.UI.WebControls.TextBox).Text = Format(Value, Me.DateType)
m_text = Nothing
Else
m_text = Value
End If
End Set
End Property
Public Property CssClass() As String
Get
EnsureChildControls()
If (Me.Controls.Count = 0) Then
Return ""
End If
Return CType(Controls(1),
System.Web.UI.WebControls.TextBox).CssClass
End Get
Set(ByVal Value As String)
If Not (Me.Controls.Count = 0) Then
CType(Controls(1),
System.Web.UI.WebControls.TextBox).CssClass = Value
m_Css = ""
Else
m_Css = Value
End If
End Set
End Property
Public Property imgCalendar() As String
Get
Return m_calendar
End Get
Set(ByVal Value As String)
m_calendar = Value
End Set
End Property
Public Property imgClose() As String
Get
Return m_closeGif
End Get
Set(ByVal Value As String)
m_closeGif = Value
End Set
End Property
Public Property imgDivider() As String
Get
Return m_dividerGif
End Get
Set(ByVal Value As String)
m_dividerGif = Value
End Set
End Property
Public Property imgDrop1() As String
Get
Return m_drop1Gif
End Get
Set(ByVal Value As String)
m_drop1Gif = Value
End Set
End Property
Public Property imgDrop2() As String
Get
Return m_drop2Gif
End Get
Set(ByVal Value As String)
m_drop2Gif = Value
End Set
End Property
Public Property imgLeft1() As String
Get
Return m_left1Gif
End Get
Set(ByVal Value As String)
m_left1Gif = Value
End Set
End Property
Public Property imgLeft2() As String
Get
Return m_left2Gif
End Get
Set(ByVal Value As String)
m_left2Gif = Value
End Set
End Property
Public Property imgRight1() As String
Get
Return m_right1Gif
End Get
Set(ByVal Value As String)
m_right1Gif = Value
End Set
End Property
Public Property imgRight2() As String
Get
Return m_right2Gif
End Get
Set(ByVal Value As String)
m_right2Gif = Value
End Set
End Property
Public Property imgDirectory() As String
Get
Return m_imgDirectory
End Get
Set(ByVal Value As String)
m_imgDirectory = Value
End Set
End Property
Public Property ControlCssClass() As String
Get
Return m_ControlCssClass
End Get
Set(ByVal Value As String)
m_ControlCssClass = Value
End Set
End Property
Public Property DateType() As String
Get
Return m_DateType
End Get
Set(ByVal Value As String)
m_DateType = Value
End Set
End Property
#End Region
Private Sub placeJavascript()
Dim strBuildUp As String = "<script language=JavaScript>"
strBuildUp += "// written by Tan Ling Wee on 2 Dec 2001" &
Chr(13)
strBuildUp += "// last updated 23 June 2002" & Chr(13)
strBuildUp += "// email : fuushikaden@yahoo.com" & Chr(13)
strBuildUp += "" & Chr(13)
strBuildUp += "var fixedX = -1 // x position (-1 if to
appear below control)" & Chr(13)
strBuildUp += "var fixedY = -1 // y position (-1 if to
appear below control)" & Chr(13)
strBuildUp += "var startAt = 1 // 0 - sunday ; 1 - monday" &
Chr(13)
strBuildUp += "var showWeekNumber = 1 // 0 - don't show; 1 -
show" & Chr(13)
strBuildUp += "var showToday = 1 // 0 - don't show; 1 - show"
& Chr(13)
strBuildUp += "var imgDir = """ & m_imgDirectory & """" &
Chr(13)
strBuildUp += "" & Chr(13)
strBuildUp += "var gotoString = ""Go To Current Month""" &
Chr(13)
strBuildUp += "var todayString = ""Today is""" & Chr(13)
strBuildUp += "var weekString = ""Wk""" & Chr(13)
strBuildUp += "var scrollLeftMessage = ""Click to scroll to