jmdoneva Posted September 30, 2016 Share Posted September 30, 2016 Can OwnerDraw be implemented for the TUniComboBox? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 30, 2016 Share Posted September 30, 2016 Hi, For what purpose you wanted to use it ? Best regards. Quote Link to comment Share on other sites More sharing options...
jmdoneva Posted September 30, 2016 Author Share Posted September 30, 2016 when you use name/value pair in a string assigned to the combobox and want to hide the value and just show the name in the dropdown you have to do a owner draw something like this procedure comboboxDrawItem(Control: TwinControl; Index: Integer; Rect : TRect; State: TOwnerDrawState); begin combobox.Canvas.TextRect(Rect, Rect.Left, Rect.Top, combobox.Items.Names[index]); end; This will show just the name portion of the name/value pair in the dropdown. The value is still there but just is hidden. So I want to hide the values and only show the names. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 30, 2016 Administrators Share Posted September 30, 2016 If you have a DB table with name value pair, you can use TUniDBLookupCombobox for same purpose. Please see UniComboBox DBLookupComboBox demo Quote Link to comment Share on other sites More sharing options...
jmdoneva Posted September 30, 2016 Author Share Posted September 30, 2016 Thank you for your help. I will work on the dblookupcombo or do something different. Sent from my XT1635-01 using Tapatalk Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.