How to set maxdowndropitems of a combobox uwp

Shay Wilner 1,726 Reputation points
2020-04-07T11:45:09.43+00:00

Hi

In windows form application combobox has maxdowndropitems propertie but not in uwp so how i can limit the drop items ?

Thanks

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Shay Wilner 1,726 Reputation points
    2020-04-08T11:39:20.287+00:00
           Dim cbitem As ComboBoxItem
    
    Comboyears.MaxDropDownHeight = 344
         For i = 1900 to 2020 
                    cbitem = New ComboBoxItem
                    With cbitem
                        .Background = brushseg
                        .FontFamily = New FontFamily("calibri")
                        .FontWeight = Windows.UI.Text.FontWeights.Bold
                        .FontSize = "21"
                        .Height = "36"
                        ..Content = "years & " " & i
    
                    End With
                    Comboyears.Items.Add(cbitem)
    
                Next
    
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Shay Wilner 1,726 Reputation points
    2020-04-07T20:14:21.293+00:00

    Ok
    I found that is better to popup the combobox using comboboxitem and i also can play with the backcolor and using the MaxDropDownHeight

    Comboyears.MaxDropDownHeight = 344
    Dim cbitem As ComboBoxItem
    For i = 1900 to 2020
    cbitem = New ComboBoxItem
    With cbitem
    .Background = brushseg
    .FontFamily = New FontFamily("calibri")
    .FontWeight = Windows.UI.Text.FontWeights.Bold
    .FontSize = "21"
    .Height = "36"
    .Content = "years & " " & i

            End With
            Comboyears.Items.Add(cbitem)
    
        Next