Hello,
I have a WinForms industrial application running on windows 7 on a touch screen. The users need to select from a drop down with about 50 items. It proves to be a hard task with a standard MS ComboBox control. The scrollbar itself is too narrow, and the users can not relibly touch the up and down arrows or the scroll bar itself with their fingers.
So I started looking for a custom combo box, but I could not find any with a customizable scroll bar width.
So, here is a question - is it possible to change the width of the scrollbar of the UltraComboEditor? I am using NetAdvantage 12.1 Win CLR2x.
And if not, is there any alternative way of easily selecting from a long list on a touch screen.
Any help will be appreciated.
What's the property called Mike? Other controls such as UltraGrid have a .ScrollBarLook, but I can't find this on the UltraComboEditor.
Mike,
thank you very very much for your help!
Your code works beautifully!
In case anyone wants the complete code, I attached the solution.
Helen.
Okay, then you have to rearrange some other elements, too.
Public Sub AfterCreateChildElements(ByVal parent As Infragistics.Win.UIElement) Implements Infragistics.Win.IUIElementCreationFilter.AfterCreateChildElements If TypeOf parent Is ValueListDropDownUIElement Then For Each element As UIElement In parent.ChildElements If TypeOf element Is ValueListItemContainerUIElement Then element.Rect = New Rectangle(element.Rect.X, element.Rect.Y, parent.Rect.Width - Me._scrollBarWidth, element.Rect.Height) ElseIf TypeOf element Is ScrollBarUIElement Then element.Rect = New Rectangle(parent.Rect.Right - Me._scrollBarWidth, element.Rect.Y, Me._scrollBarWidth, element.Rect.Height) End If Next End If If TypeOf parent Is ScrollBarUIElement Then For Each element As UIElement In parent.ChildElements If TypeOf element Is ScrollButtonUIElement Then Dim scrollButtonUIElement As ScrollButtonUIElement = DirectCast(element, ScrollButtonUIElement) If scrollButtonUIElement.ScrollButtonType = ScrollButton.Up Then element.Rect = New Rectangle(element.Rect.X, element.Rect.Y, element.Rect.Width, Me._buttonHeight) ElseIf scrollButtonUIElement.ScrollButtonType = ScrollButton.Down Then element.Rect = New Rectangle(element.Rect.X, parent.Rect.Bottom - Me._buttonHeight, element.Rect.Width, Me._buttonHeight) End If ElseIf TypeOf element Is ScrollTrackUIElement Then element.Rect = New Rectangle(element.Rect.X, parent.Rect.Top + Me._buttonHeight, element.Rect.Width, parent.Rect.Height - (Me._buttonHeight * 2)) End If Next End If End Sub
here is a larger image of the combo box.
Hi Mike,
thank you for your help.
The reason Georgi's sample is so complicated is because I asked how to get up and down buttons to be taller - see his image above.
With the code you kindly provided, the up and down buttons are even shorter than normal - see the image I attached.
My users are used to poke at the up and down buttons, and it is hard to educate them as they work three shifts and mostly computer illiterate.
I would appretiate your help in this.
Thanks,