Public Class MyMaskBox Enum Inputtype ÀüºÎ = 1 ¼ýÀÚ = 2 ¹®ÀÚ = 3 ¼Ò¹®ÀÚ = 5 ´ë¹®ÀÚ = 6 End Enum Dim ColName As String Dim Coltype As OleDbType = OleDbType.VarChar Dim Ditem As Boolean Dim Prompt As String Dim WhereState As String = vbNullString Dim NotNull As Boolean = False Dim iNTYPE As Inputtype = Inputtype.ÀüºÎ Dim DEF_VALUE As String = Me.Text Protected Var_ViewColNumber As Short Protected Var_BaseLabel As Label _ Public Property DB_BaseLabel() As Label Get Return Var_BaseLabel End Get Set(ByVal value As Label) '//µ¥ÀÌÅͰ¡ µé¾î¿À¸é ÇöÀçÀÇ ÇÁ·ÒÇÁÆ®¸¦ °»½ÅÇÕ´Ï´Ù. Var_BaseLabel = value Me.DB_Prompt = Prompt End Set End Property _ Public Property WHERE_DEFAULT_VALUE() As String Get Return DEF_VALUE End Get Set(ByVal value As String) DEF_VALUE = value End Set End Property _ Public Property Input_type() As Inputtype Get Return iNTYPE End Get Set(ByVal value As Inputtype) iNTYPE = value End Set End Property _ Public Property DB_NotNull() As Boolean Get Return NotNull End Get Set(ByVal value As Boolean) NotNull = value End Set End Property _ Public Property DB_WhereType() As String Get Return WhereState End Get Set(ByVal value As String) WhereState = value End Set End Property _ Public Property DB_Prompt() As String Get Return IIf(Prompt Is vbNullString, DB_ColName, Prompt) End Get Set(ByVal value As String) Prompt = value End Set End Property _ Public Property DB_ColName() As String Get If ColName = "" Then Return Me.Name Else Return ColName End If End Get Set(ByVal value As String) ColName = value End Set End Property _ Public Property DB_Type() As OleDbType Get Return Coltype End Get Set(ByVal value As OleDbType) Coltype = value End Set End Property _ Public Property DB_ITEM() As Boolean Get Return Ditem End Get Set(ByVal value As Boolean) Ditem = value End Set End Property ''' ''' ÇöÀç °ªÀ» ¼³Á¤Çϰųª ¹ÝȯÇÕ´Ï´Ù. ''' ''' ''' ''' _ Public Property Value() As String Get Return Me.Text End Get Set(ByVal value As String) If value.ToUpper = "$$DATE$$" Then Me.Text = Format(Now, "yyyyMMdd") Else Me.Text = value End If End Set End Property Private Sub MyMaskTextBox_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Me.SelectAll() End Sub Private Sub TextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Select Case iNTYPE Case Inputtype.´ë¹®ÀÚ If Char.IsNumber(e.KeyChar) Then e.Handled = True Else e.KeyChar = Char.ToUpper(e.KeyChar.ToString) End If 'If Not Char.IsUpper(e.KeyChar.ToString) Then e.Handled = True Case Inputtype.¹®ÀÚ If Char.IsNumber(e.KeyChar) Then e.Handled = True ' If Not Char.IsLetter(e.KeyChar.ToString) Then e.Handled = True Case Inputtype.¼Ò¹®ÀÚ If Char.IsNumber(e.KeyChar) Then e.Handled = True Else e.KeyChar = Char.ToLower(e.KeyChar.ToString) End If 'If Not Char.IsLower(e.KeyChar.ToString) Then e.Handled = True Case Inputtype.¼ýÀÚ If Char.IsLetter(e.KeyChar) Then e.Handled = True End Select End Sub Private Sub TextBox_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) If e.KeyCode = Keys.Enter Then SendKeys.Send("{TAB}") If e.Alt AndAlso e.KeyCode = Keys.Enter Then SendKeys.Send("+{TAB}") End Sub Private Sub TextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) If Me.NotNull = True AndAlso Me.Text = "" Then Me.ErrorProvider1.SetError(Me, "ÀÌ Çʵå´Â ¹Ýµå½Ã ÀԷµǾî¾ßÇÕ´Ï´Ù") Else Me.ErrorProvider1.Clear() End If End Sub End Class