My first question - be gentle. lazarus / 10-Designer ---------------------------------------------------------------------- swampy · 2006-11-03 12:13 Hi. This is my first post, beyond my initial gee-whiz-this-is-great post.    :wink: It's a question regarding tComboBox. I hope I'm asking this in a reasonable place, but I'm not very familiar with the site yet. I did try searching about tComboBox but I haven't had much luck finding my particular issue, though it's entirely possible that I didn't search for it very intelligently.  Anyway... I'm using a tComboBox in csDropDownList style. Elsewhere on the panel, I have a button "Set Defaults" which programatically sets the ComboBox's ItemIndex to 0.  So far so good. I can manually select items from the dropdown box, or I can press my button and have the first item selected that way.  After pressing my button, I can go back to using the dropdown box manually ...unless the item I select is the same item which had been selected just before the programatic change.  If I try to select that one, nothing happens - the dropdown folds up, but the text and the ItemIndex remain unchanged. What am I doing wrong? ---------------------------------------------------------------------- matthijs · 2006-11-03 14:59 I do not understand your problem. Maybe you could post some code where things go wrong? ---------------------------------------------------------------------- theo · 2006-11-03 15:26 Quote from: "matthijs"I do not understand your problem. Maybe you could post some code where things go wrong? I think it's simple and he's right. - Have a TCombobox with some items on a Form and a TButton. - Select an Item in Combobox manually (remember this item) - Then select an Itemindex with TButton like: Code: [Select]procedure TForm1.Button1Click(Sender: TObject); begin   ComboBox1.ItemIndex:=3; end;           Then try to manually select the item you remember - > It doesn't change /select. GTK That is. ---------------------------------------------------------------------- swampy · 2006-11-03 18:17 Matthijs: You're right, I should have been a little more clear and concise. I'll try to take a lesson from Theo in the future - provide a code snippit and stepwise instructions for reproducing the observed behaviour. Related notes to Self: - mention problem in subject line - mention OS:  debian linux (ubuntu dapper with gnome). - mention lazarus version 0.9.18 beta Date: 16-10-06 SVN Revision: 9891 Theo: Thank you very much!  I can see that you actually did the experiment. That's very kind of you.  Thank you also for your superior explanation. ...and, thank you both for responding so quickly. Hopefully someone can suggest a better way to change a ComboBox programatically, or failing that, perhaps a work-around? ---------------------------------------------------------------------- theo · 2006-11-03 19:50 Quote from: "swampy" Hopefully someone can suggest a better way to change a ComboBox programatically, or failing that, perhaps a work-around? I think it's a bug. Please report it: http://wiki.lazarus.freepascal.org/How_do_I_create_a_bug_report ---------------------------------------------------------------------- swampy · 2006-11-04 00:40 Theo: I went to the bug tracker link you provided above, and was about to file a report, when I noticed that Matthijs had already today filed a report relating to tComboBox and its ItemIndex.  While it doesn't seem to be exactly the same issue as mine, rather than open a whole new report, I attached a note to his and a little demo project as a tar ball.  I hope that was a reasonable approach. Thanks again, Swampy. ---------------------------------------------------------------------- felipemdc · 2006-11-04 01:30 Thank you very much. Attaching test projects significantly diminishes the time necessary to fix bugs. ---------------------------------------------------------------------- matthijs · 2006-11-04 15:44 Quote from: "swampy" I went to the bug tracker link you provided above, and was about to file a report, when I noticed that Matthijs had already today filed a report relating to tComboBox and its ItemIndex. [..] It is certainly possible your problem is related to the bug I reported. I came across this bug when I tried to research your problem. ---------------------------------------------------------------------- swampy · 2007-02-01 16:46 I see on the bugs@freepascal.org mailing list that issue 1495 relating to tComboBox is currently receiving some attention. To me, it looks hopeful that what they're doing will fix this little matter as well. At some point I'm going to have to figure out how to get and apply all these patches they mention. I'm too afraid that I'm going to break Lazarus and never be able to get it back.  :shock: ---------------------------------------------------------------------- matthijs · 2007-02-01 17:33 It is not so hard to apply the patches. Just download a daily snapshot and install it. Or wait for next beta release. Daily snapshots can be found here.