Nadya Posted August 20, 2020 Share Posted August 20, 2020 Hello! I have a UniComboBox with variants of data I should display, so I need to know the ItemIndex of selected item. To prevent changing the text of ComboBox manually, I set ReadOnly = True, and ReadOnlyMode = urmNotEditable. In that case ItemIndex value doesn't change, when I select an item in runtime If ReadOnly = False - itemIndex updates correctly, but I user can type any text to ComboBox text area and ItemIndex in that case = -1, it's not a good idea I think I can't set Enabled = False, cause user would not be able select items Is there any way to solve this problem? Thanks a lot for help! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 Hello, Are you using the latest build? Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Author Share Posted August 20, 2020 13 minutes ago, Sherzod said: Are you using the latest build? 1.90.0.1535 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 4 minutes ago, Nadya said: 1.90.0.1535 Ok, thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 What if you use this approach? 1. ReadOnly = False 2. Style = csDropDownList 1 Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Author Share Posted August 20, 2020 I've solved it! I had Style = csDropDown. If ReadOnly=True and Style = csDropDownList - it works perfectly! Sorry for disturbance Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Author Share Posted August 20, 2020 1 minute ago, Sherzod said: What if you use this approach? 1. ReadOnly = False 2. Style = csDropDownList Thank you! You're geniuos, did you know? 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 10 minutes ago, Nadya said: Thank you! You're geniuos, did you know? Thank you! If I was a genius... Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Author Share Posted August 20, 2020 9 minutes ago, Sherzod said: Thank you! If I was a genius... If you wasn't a genius you would already go crazy with such clients like me Sorry for offtop 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.