Updated 8/29/2018 - Formatted
In my recent window application there is need to create a Checked listbox that has dropdown functionality, so I created a user control with the help of checkedlistbox, textbox, button controls and windows.form object that is so useful for me.
This user controls have these features:
  1. Control has drop down functionality
  2. Control show status of selected items like 'All selected', 'None selected' and 'N items selected '.
  3. We able to set the length of dropdown list.
  4. We can bind items on design time or runtime etc.
dropdownCheckedListBox-in-VB.NET.jpg
How to make
Add a user control in your application with the name 'DropDownCheckedListBox'.
Add textbox, button, checkedlistbox controls in this user control set the position like below
dropdownCheckedListBox1-in-VB.NET.jpg
Open code file and make some private variable and some public properties
  1. Private Const T_DisplayListSize As Integer = 6
  2. Private Const SelectNoneText As String = "(None Selected)"
  3. Private Const SelectAllText As String = "(All Selected)"
  4. Private Const SelectSomeText As String = "(Some Selected...)"
  5. Private Frm As Form
  6. Private LostFocus As Boolean
  7. Private CodeValue As String
  8. Private T_MustFill As Boolean
  9. Private Shared m_ChkItemsString As String
  10. Public Event DropDown()
  11. Public Shadows Event TextChanged()
  12. Public Event SetStatusPrompt(ByVal Sender As DropDownCheckedListBox)
  13. Public Event AllItemSelected(ByVal Sender As DropDownCheckedListBox)
  14. Public Event AllItemDeselected(ByVal Sender As DropDownCheckedListBox)
Public properties
Make some public properties for the itemslist and length of dropdown list etc.
  1. Private dataList() As String
  2. Public Property Items() As String()
  3. Get
  4. Return dataList
  5. End Get
  6. Set(ByVal value As String())
  7. dataList = value
  8. End Set
  9. End Property
  10. Private ListSize As Integer
  11. Public Property DisplayListSize() As Integer
  12. Get
  13. Return ListSize
  14. End Get
  15. Set(ByVal value As Integer)
  16. ListSize = value
  17. SetList()
  18. End Set
  19. End Property
  20. Private T_DroppedDown As Boolean
  21. Public ReadOnly Property DroppedDown() As Boolean
  22. Get
  23. Return T_DroppedDown
  24. End Get
  25. End Property
  26. Private T_ListText As String
  27. Public ReadOnly Property ListText() As String
  28. Get
  29. Return T_ListText
  30. End Get
  31. End Property
Add new function InitializeNew() in Sub new()
  1. Public Sub New()
  2. InitializeComponent()
  3. InitializeNew()
  4. End Sub
  5. Private Sub InitializeNew()
  6. Dim strTemp As String
  7. ListSize = T_DisplayListSize
  8. T_DroppedDown = False
  9. T_ListText = ""
  10. T_MustFill = False
  11. txt.Text = strTemp
  12. chkListBox.Hide()
  13. Frm = New Form
  14. With Frm
  15. .ShowInTaskbar = False
  16. .FormBorderStyle = FormBorderStyle.None
  17. .ControlBox = False
  18. .StartPosition = FormStartPosition.Manual
  19. .TopMost = True
  20. .Location = chkListBox.Location
  21. .Width = chkListBox.Width
  22. .Controls.Add(chkListBox)
  23. End With
  24. SetSize()
  25. End Sub
Create mousedown event of btnDropDown button and call function listButtonClick on here. This is responsible for showing checkedListBox
  1. Private Sub btnDropdown_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnDropdown.MouseDown
  2. ListButtonClick()
  3. End Sub
We have already make two custom event one is TextChanged and another is DropDown, on here both event have been raised. So we can handle events when control changes its status(user check or uncheck item(s)).
  1. Private Sub ListButtonClick()
  2. Dim strTemp As String
  3. strTemp = T_ListText
  4. If T_DroppedDown Then
  5. T_DroppedDown = False
  6. txt.Text = GetSelectedItems()
  7. chkListBox.Hide()
  8. Frm.Hide()
  9. txt.Focus()
  10. If Not strTemp = T_ListText Then
  11. RaiseEvent TextChanged()
  12. End If
  13. ElseIf Not LostFocus Then
  14. T_DroppedDown = True
  15. SetSize()
  16. Frm.Show()
  17. chkListBox.Show()
  18. chkListBox.Focus()
  19. RaiseEvent DropDown()
  20. End If
  21. LostFocus = False
  22. End Sub
  23. Private Sub SetList()
  24. Dim oFrm As Form
  25. Dim oRect As Rectangle
  26. Dim oPt As Point
  27. If Frm IsNot Nothing Then
  28. Frm.Height = (ListSize * chkListBox.ItemHeight) + 3
  29. chkListBox.Height = Frm.Height
  30. chkListBox.Top = 0
  31. oFrm = Me.FindForm
  32. If oFrm IsNot Nothing Then
  33. oPt = Me.ParentForm.PointToClient(Me.PointToScreen(Point.Empty))
  34. oPt.Y = oPt.Y + Me.txt.Height
  35. oRect = oFrm.RectangleToScreen(oFrm.ClientRectangle)
  36. oPt.X = oPt.X + oRect.Left
  37. oPt.Y = oPt.Y + oRect.Top
  38. Frm.Location = oPt
  39. End If
  40. Frm.Width = chkListBox.Width
  41. End If
  42. End Sub
SetSize() function works for set the size of all controls if you can resize usercontrol.
  1. Private Sub SetSize()
  2. LostFocus = False
  3. txt.Width = Me.Width
  4. btnDropdown.Left = txt.Width - btnDropdown.Width - 2
  5. chkListBox.Width = Me.Width
  6. Me.Height = txt.Height
  7. SetList()
  8. End Sub
Working with control
Build your application, the DropDownCheckedListBox should appear in your Visual Studio ToolBox and then you can drag and drop it on to your windows Form.
Add items on design time.

dropdownCheckedListBox1-AddItems-in-VB.NET.jpg
Click on items property, add strings and click ok
You can apply more functionalities according your need in this user control. You can download full source code sample.