Showing posts with label ComboBox. Show all posts
Showing posts with label ComboBox. Show all posts

MultiCoulum ComboBox

Menampilkan data drop down telah disediakan oleh visual basic yaitu ComboBox. Combo Box hanya menampilkan satu coloum. Bagaimanakah kita menampilkan combobox dengan beberapa coloum (Multi Coloum ComboBox)? Seperti contoh code berikut ini.


ComboBox Di Dalam DBGrid

Berikut saya berikan contoh Source Code ComboBox Di Dalam DBGrid
Private Sub Combo1_GotFocus()
Const CB_SHOWDROPDOWN = H14F
Dim Tmp
Tmp = SendMessage(Combo1.hwnd, CB_SHOWDROPDOWN, 1, ByVal 0)
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
DBGrid1.Text = Combo1.Text
DBGrid1.SetFocus
End If
End Sub
Private Sub Combo1_LostFocus()
Combo1.Visible = False
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub DBGrid1_ButtonClick(ByVal ColIndex As Integer)
Combo1.Top = DBGrid1.Top + DBGrid1.RowTop(DBGrid1.Row)
Combo1.Visible = True
Combo1.SetFocus
If Not (DBGrid1.Text = "") Then
Combo1.Text = DBGrid1.Text
End If
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\Data1.mdb"
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Demikian Code Visual Basic menempatkan ComboBox di dalam DBGrid semoga bermanfaat.Program lengkapnya bisa di download di sini.

About Me

Followers

Home | Profile | Blogger | Template