Imports System.Text Imports System.Data Public Class MyCheckBox Dim ColName As String Dim Coltype As OleDbType Dim Ditem As Boolean Dim CheckVal As String Dim UnCheckVal As String Dim otherval As Boolean Dim Prompt As String Dim WhereState As String = vbNullString Dim POS As Int16 Protected Var_ViewColNumber As Short Protected Var_BaseLabel As Label Private VAR_USERCLICK As Boolean = False '//¿ìŬ¸¯½Ã ºñȰ¼ºÈ­µÇ´Âµ¥ ±× ±â´ÉÀÇ »ç¿ë¿©ºÎÀÌ´Ù. ''' ''' ¿ìŬ¸¯½Ã ÄÁÆ®·Ñ ºñȰ¼ºÈ­ ±â´É¿©ºÎ ''' ''' ''' ''' _ Public Property DB_USERCLICK() As Boolean Get Return VAR_USERCLICK End Get Set(ByVal value As Boolean) VAR_USERCLICK = value End Set End Property ''' ''' ÀÌ ÄÁÆ®·Ñ°ú ¿¬°áµÈ ·¹À̺íÀ» ¼³Á¤/¹Ýȯ ÇÕ´Ï´Ù. ''' ''' ''' ''' _ 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 ''' ''' °Ë»öºí·°¿¡ ¼ÓÇØÀÖÀ»¶§ÀÇ °Ë»öÁ¶°Ç ''' ''' ''' ''' = <= LIKE")> _ 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 DB_Prompt = value End Set End Property _ Public Property DB_OtherValue() As Boolean Get Return otherval End Get Set(ByVal value As Boolean) otherval = False End Set End Property _ Public Property DB_CheckValue() As String Get Return CheckVal End Get Set(ByVal value As String) CheckVal = value End Set End Property _ Public Property DB_UnCheckVal() As String Get Return UnCheckVal End Get Set(ByVal value As String) UnCheckVal = value End Set End Property _ Public Property Value() As String Get If Me.CheckState = Windows.Forms.CheckState.Indeterminate Then Return Nothing Else Return IIf(Me.Checked, CheckVal, UnCheckVal) End If End Get Set(ByVal value As String) Select Case value Case CheckVal Me.Checked = True Case UnCheckVal Me.Checked = False Case Else Me.Checked = otherval End Select 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 Private Sub CheckBox_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) If e.KeyCode = Keys.Enter Then SendKeys.Send("{TAB}") If Me.VAR_USERCLICK AndAlso e.KeyCode = Keys.Escape Then '//¿ìÃø¹öư Ŭ¸¯½Ã ºñȰ¼ºÈ­ÇÑ´Ù Me.CheckState = Windows.Forms.CheckState.Indeterminate End If End Sub Private Sub CheckBox_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) If Me.VAR_USERCLICK AndAlso e.Button = Windows.Forms.MouseButtons.Right Then '//¿ìÃø¹öư Ŭ¸¯½Ã ºñȰ¼ºÈ­ÇÑ´Ù Me.CheckState = Windows.Forms.CheckState.Indeterminate End If End Sub End Class