LboxDate


  DateTimePicker を継承




  

Public Shared validateNone As Boolean = False

' ****************************************************** 
' validate コントロール用
' ****************************************************** 
Protected Overloads Overrides Sub OnValidating( _
  ByVal e As System.ComponentModel.CancelEventArgs)

	' ****************************************************** 
	' validateNone が True ならば、Valdating は発生しない 
	' ****************************************************** 
	If Not validateNone Then
		If Me.Enabled = True Then
			MyBase.OnValidating(e)
		End If
	End If

End Sub

Protected Overloads Overrides Sub OnValidated( _
 ByVal e As System.EventArgs)

	' ****************************************************** 
	' validateNone が True ならば、Validated は発生しない 
	' ****************************************************** 
	If Not validateNone Then
		If Me.Enabled = True Then
			MyBase.OnValidated(e)
		End If
	End If

End Sub

' ****************************************************** 
' 文字列としてのデータ
' ****************************************************** 
Public Property InnerText() As String

	Get
		If Not Me.Checked Then
			Return ""
		Else
			Return Me.Value.ToString("d")
		End If

	End Get
	Set(ByVal value As String)

		Try
			Me.Value = Date.Parse(value)
		Catch ex As Exception
			Me.Value = Date.Today
		End Try

		If value = "" Then
			Me.Checked = False
		Else
			Me.Checked = True
		End If

	End Set

End Property

' ****************************************************** 
' SQL用文字列としてのデータ
' ****************************************************** 
Private _DbDefault As String = "NULL"
Public ReadOnly Property DbText() As String

	Get
		If Not Me.Checked Then
			Return _DbDefault
		Else
			Return "'" + Me.Value.ToString("d") + "'"
		End If
	End Get

End Property

' ****************************************************** 
' SQL用デフォルトデータ
' ****************************************************** 
Public Property DbDefault() As String

	Get
		Return _DbDefault
	End Get
	Set(ByVal value As String)
		_DbDefault = value
	End Set

End Property

' ****************************************************** 
' カスタムチェックタイプ
' ****************************************************** 
Private _CheckType As Integer = 0
<System.ComponentModel.Description("0:なし" & Chr(10) & "1:必須入力"), _
 System.ComponentModel.DefaultValue(0)> _
Public Property CheckType() As Integer
	Get
		Return _CheckType
	End Get
	Set(ByVal value As Integer)
		_CheckType = value
	End Set
End Property

' ****************************************************** 
' 同一処理支援
' ****************************************************** 
Private _Group As Integer = 1
<System.ComponentModel.DefaultValue(1)> _
  Public Property Group() As Integer
	Get
		Return _Group
	End Get
	Set(ByVal value As Integer)
		_Group = value
	End Set
End Property

' ****************************************************** 
' 全体のチェック
' ****************************************************** 
Private Sub LboxDate_Validating(ByVal sender As System.Object, _
 ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Validating

	' 必須入力
	If Me._CheckType = 1 Then
		If Not Me.Checked Then
			MessageBox.Show("必須入力です   ", _
			"エラー", MessageBoxButtons.OK, MessageBoxIcon.Error)
			e.Cancel = True
		End If
	End If

End Sub
  










yahoo  google  MSDN  MSDN(us)  WinFAQ  Win Howto  tohoho  ie_DHTML  vector  wdic  辞書  天気 


[dnettool]
claudebot
24/03/29 22:02:12
InfoBoard Version 1.00 : Language=Perl

1 BatchHelper COMprog CommonSpec Cprog CprogBase CprogSAMPLE CprogSTD CprogSTD2 CprogWinsock Cygwin GameScript HTML HTMLcss InstallShield InstallShieldFunc JScript JScriptSAMPLE Jsfuncs LLINK OldProg OracleGold OracleSilver PRO PRObrowser PROc PROconePOINT PROcontrol PROftpclient PROjscript PROmailer PROperl PROperlCHAT PROphp PROphpLesson PROphpLesson2 PROphpLesson3 PROphpfunction PROphpfunctionArray PROphpfunctionMisc PROphpfunctionString PROsql PROvb PROvbFunction PROvbString PROvbdbmtn PROvbonepoint PROwebapp PROwin1POINT PROwinSYSTEM PROwinYOROZU PROwindows ProjectBoard RealPHP ScriptAPP ScriptMaster VBRealtime Vsfuncs a1root access accreq adsi ajax amazon argus asp aspSample aspVarious aspdotnet aw2kinst cappvariety centura ckeyword classStyle cmaterial cmbin cmdbapp cmenum cmlang cmlistbox cmstd cmstdseed cmtxt cs daz3d db dbCommon dbaccess dnettool dos download flex2 flex3 flex4 framemtn framereq freeWorld freesoft gimp ginpro giodownload google hdml home hta htmlDom ie9svg install java javaSwing javascript jetsql jquery jsp jspTest jspVarious lightbox listasp listmsapi listmsie listmsiis listmsnt listmspatch listmsscript listmsvb listmsvc memo ms msde mysql netbeans oraPlsql oracle oracleWiper oraclehelper orafunc other panoramio pear perl personal pgdojo pgdojo_cal pgdojo_holiday pgdojo_idx pgdojo_ref pgdojo_req php phpVarious phpguide plsql postgres ps r205 realC realwebapp regex rgaki ruby rule sboard sc scprint scquest sdb sdbquest seesaa setup sh_Imagick sh_canvas sh_dotnet sh_google sh_tool sh_web shadowbox shgm shjquery shvbs shweb sjscript skadai skywalker smalltech sperl sqlq src systemdoc tcpip tegaki three toolbox twitter typeface usb useXML vb vbdb vbsfunc vbsguide vbsrc vpc wcsignup webanymind webappgen webclass webparts webtool webwsh win8 winofsql wmi work wp youtube