none
Special combobox RRS feed

  • Question

  • Hi Everyone:

    I am using vb.net 2019.  Does anyone know what is the attached combobox dropdown called, and how to make a combobox like it?  I do not know what is this kind of combobox called to search for it.  Thanks;

    Bob

    Wednesday, July 10, 2019 8:11 PM

Answers

  • Hello,

    There are no known solution as the image depicts a UITypeEditor as it would have to be created.

    This is coming from a PropertyGrid, for the Dock property (it appears to be) a UITypeEditor was designed specifically for this task e.g. DockEditor.

    The following will not answer your question but will show the basics to creating something similar BUT can't be used on a form

    https://www.codeproject.com/Articles/13630/Add-Custom-Properties-to-a-PropertyGrid

    What needs to be done is to perform custom draw e.g. (still not a solution)

    https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.combobox.dropdownstyle?view=netframework-4.8


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange


    Wednesday, July 10, 2019 9:25 PM
    Moderator
  • Hi,

    It should be a user control, contains multiple controls,like this:

    Public Class Form1
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
            Me.Panel1.Visible = False
        End Sub
    
        Private Sub ComboBox1_DropDown(sender As Object, e As EventArgs)
            Me.Panel1.Visible = True
    
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Me.TextBox1.Clear()
            Me.TextBox1.Text = "Top"
            Me.Panel1.Visible = False
        End Sub
    
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            Me.TextBox1.Clear()
            Me.TextBox1.Text = "Left"
            Me.Panel1.Visible = False
        End Sub
    
        Private Sub TextButton_Click(sender As Object, e As EventArgs) Handles TextButton.Click
            Me.Panel1.Visible = IIf(Me.Panel1.Visible = True, False, True)
        End Sub
    
    
    End Class
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 15, 2019 5:55 AM
    Moderator

All replies

  • Hello,

    There are no known solution as the image depicts a UITypeEditor as it would have to be created.

    This is coming from a PropertyGrid, for the Dock property (it appears to be) a UITypeEditor was designed specifically for this task e.g. DockEditor.

    The following will not answer your question but will show the basics to creating something similar BUT can't be used on a form

    https://www.codeproject.com/Articles/13630/Add-Custom-Properties-to-a-PropertyGrid

    What needs to be done is to perform custom draw e.g. (still not a solution)

    https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.combobox.dropdownstyle?view=netframework-4.8


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange


    Wednesday, July 10, 2019 9:25 PM
    Moderator
  • Thanks Karen.  I will look into your suggestion (sites).  In my application, the dropdown portion needs to display the top, bottom, left, right, top-left corner, etc location of an image and the user would select them to tell the application where to place a writing.  Thanks for your help.

    Bob

    Wednesday, July 10, 2019 10:02 PM
  • Hi,

    It should be a user control, contains multiple controls,like this:

    Public Class Form1
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    
            Me.Panel1.Visible = False
        End Sub
    
        Private Sub ComboBox1_DropDown(sender As Object, e As EventArgs)
            Me.Panel1.Visible = True
    
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Me.TextBox1.Clear()
            Me.TextBox1.Text = "Top"
            Me.Panel1.Visible = False
        End Sub
    
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            Me.TextBox1.Clear()
            Me.TextBox1.Text = "Left"
            Me.Panel1.Visible = False
        End Sub
    
        Private Sub TextButton_Click(sender As Object, e As EventArgs) Handles TextButton.Click
            Me.Panel1.Visible = IIf(Me.Panel1.Visible = True, False, True)
        End Sub
    
    
    End Class
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 15, 2019 5:55 AM
    Moderator