<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class UserControl
Inherits System.Windows.Forms.TextBox
'UserControl はコンポーネント一覧をクリーンアップするために dispose をオーバーライドします。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Windows フォーム デザイナで必要です。
Private components As System.ComponentModel.IContainer
'メモ: 以下のプロシージャは Windows フォーム デザイナで必要です。
'Windows フォーム デザイナを使用して変更できます。
'コード エディタを使って変更しないでください。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
' Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
End Sub
End Class
Public Class UserControl
' ******************************************************
' Valdating コントロールフラグ
' ******************************************************
Public Shared validateNone As Boolean = False
Protected Overrides Sub OnValidating(ByVal e As System.ComponentModel.CancelEventArgs)
' ******************************************************
' validateNone が True ならば、Valdating は発生しない
' ******************************************************
If Not validateNone Then
MyBase.OnValidating(e)
End If
End Sub
Protected Overrides Sub OnValidated(ByVal e As System.EventArgs)
' ******************************************************
' validateNone が True ならば、Validated は発生しない
' ******************************************************
If Not validateNone Then
MyBase.OnValidated(e)
End If
End Sub
End Class
' ******************************************************' キャンセル' ******************************************************
Private Sub キャンセル_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles キャンセル.Click
UserControl.validateNone = True
Me.ヘッド部.Enabled = True
Me.ボディ部.Enabled = False
Dim obj As Object
For Each obj In Me.ボディ部.Controls
If obj.GetType().ToString() = "System.Windows.Forms.TextBox" Then
CType(obj, System.Windows.Forms.TextBox).Clear()
CType(obj, System.Windows.Forms.TextBox).Enabled = True
End If
Next
' -------------------------------------------------
' DateTimePicker の初期化
' -------------------------------------------------
Me.生年月日.Enabled = True
Me.生年月日.Value = CDate(Today().Date)
Me.生年月日.Checked = False
Me.社員コード.Focus()
Me.社員コード.SelectAll()
End Sub
拡張子:
' ******************************************************' + ステータスメッセージ' ******************************************************
Private Sub 社員コード_GotFocus(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles 社員コード.GotFocus
UserControl.validateNone = False
Me.通常ラベル.Text = "社員コードを入力して下さい ( F6 : 参照 ) "
End Sub