Setting the property to 0 results in the dropdown list autosizing its width to be equal to the control's width
Setting the property to -1 results in the dropdown list autosizing its width to accommodate the longest item's text
Private Sub SwapAlignment() Me.UltraComboEditor1.DropDownListWidth = 150 If Me.UltraComboEditor1.DropDownButtonAlignment = Infragistics.Win.ButtonAlignment.Right Then Me.UltraComboEditor1.DropDownButtonAlignment = Infragistics.Win.ButtonAlignment.Left Me.UltraComboEditor1.DropDownListAlignment = Infragistics.Win.DropDownListAlignment.Right Else Me.UltraComboEditor1.DropDownButtonAlignment = Infragistics.Win.ButtonAlignment.Right Me.UltraComboEditor1.DropDownListAlignment = Infragistics.Win.DropDownListAlignment.Left End If End Sub
private void SwapAlignment() { this.ultraComboEditor1.DropDownListWidth = 150; if(this.ultraComboEditor1.DropDownButtonAlignment == Infragistics.Win.ButtonAlignment.Right) { this.ultraComboEditor1.DropDownButtonAlignment = Infragistics.Win.ButtonAlignment.Left; this.ultraComboEditor1.DropDownListAlignment = Infragistics.Win.DropDownListAlignment.Right ; } else { this.ultraComboEditor1.DropDownButtonAlignment = Infragistics.Win.ButtonAlignment.Right; this.ultraComboEditor1.DropDownListAlignment = Infragistics.Win.DropDownListAlignment.Left; } }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2