Imports System.Text Imports System.Data Imports System Public Class MyCombo Dim ColName As String Dim Coltype As OleDbType = OleDbType.VarChar Dim Ditem As Boolean Dim SQl As String Dim QueryType As Boolean = False Dim Prompt As String Dim WhereState As String = vbNullString Dim POS As Int16 Dim StaticList As String = vbNullString '//Äõ¸®¾ÆÀÌÅÛÀÌ¾Æ´Ñ ¼öµ¿¾ÆÀÌÅÛ¿ë ¸ñ·ÏÀ» ÀúÀåÇÑ´Ù. Dim QueryList As String = vbNullString '//Äõ¸®¾ÆÀÌÅ۽à ¼öµ¿À¸·Î ÀÔ·ÂÇÒ ¸ñ·ÏÀ» ÀúÀåÇÑ´Ù. Dim NotNull As Boolean = False _ 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_POs() As Int16 Get Return POS End Get Set(ByVal value As Int16) POS = value 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_Query() As String Get Return SQl End Get Set(ByVal value As String) SQl = value End Set End Property _ Public Property DB_QueryType() As Boolean Get Return QueryType End Get Set(ByVal value As Boolean) QueryType = value End Set End Property _ Public Property DB_QueryItem() As String Get Return QueryList End Get Set(ByVal value As String) QueryList = value End Set End Property _ Public Property DB_StaticItem() As String Get Return StaticList End Get Set(ByVal value As String) StaticList = 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 If Me.SelectedValue = "" Then Return Me.Text Else Return Me.SelectedValue End If End Get Set(ByVal value As String) Me.SelectedValue = value If Me.SelectedValue Is vbNullString Then Me.Text = value End Set End Property ''' ''' ÁöÁ¤µÈ ¸ñ·ÏÀ¸·Î ¾÷µ¥ÀÌÆ® ''' ''' Public Sub UpdateItem() Dim NTab As New DataTable Dim UserRow As DataRow If QueryType = True Then '//Äõ¸®¸¦ »ç¿ëÇØ¼­ ¾ÆÀÌÅÛÀ» ¾µ¶§ 'DB.DB_SQL = (SQl) ' DB.Get_Data(NTab) 'NTab = DB.Get_TABLE If Not QueryList Is Nothing Then If QueryList.Trim.Length > 0 Then For Each R As String In QueryList.Split(":") UserRow = NTab.NewRow UserRow(0) = R.Split(",")(0) UserRow(1) = R.Split(",")(1) NTab.Rows.InsertAt(UserRow, R.Split(",")(2)) Next End If End If 'If QueryList <> Nothing OrElse QueryList.Trim.Length > 0 Then '//Ãß°¡Äõ¸®¸ñ·ÏÀÌ ÀÖÀ»°æ¿ì¿¡ Ãß°¡ÇØÁØ´Ù. 'For Each R As String In QueryList.Split(",") 'NTab.Rows.Add(R.Split(",")) 'Next 'End If Me.DataSource = NTab Me.DisplayMember = Me.DisplayMember Me.ValueMember = Me.ValueMember Else '//Äõ¸®°¡¾Æ´Ñ staticitem À» µ¥ÀÌÅÍÅ×À̺í·Î ¸¸µé¾î¼­ ÇÑ´Ù. If StaticList = "" Then Exit Sub Dim A As New DataTable("NEWTAB") Dim CDIV() As String = StaticList.Split(":") A.Columns.Add("DSP") A.Columns.Add("VAL") 'SataicList ¸¦ :·Î ºÐÇÒÇÑµÚ , µ¥ÀÌÅ͸¦ ³ª´«´Ù. For Each R As String In CDIV A.Rows.Add(R.Split(",")) Next Me.DataSource = A Me.DisplayMember = "DSP" Me.ValueMember = "VAL" End If End Sub Private Sub ComboBOx_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp If e.KeyCode = Keys.Enter Then SendKeys.Send("{TAB}") End Sub End Class