Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Win 32 Controls/TComboBoxEx    [ Add a report in this area ]  
Report #:  10544   Status: Closed
TComboBoxEx loses Data parameter
Project:  Delphi Build #:  24408
Version:    9.0 Submitted By:   Elric Pedder
Report Type:  Crash / Data loss / Total failure Date Reported:  1/21/2005 3:19:49 PM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   219240
Resolution: Fixed (Resolution Comments) Resolved in Build: : 9.0.1882.30496
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
It seems that TComboBoxEx items lose their Data parameter at some point after the form is displayed.  This only happens on forms other than the application main form, but it is very repeatable.  

I have two screenshots, the first compiled with D7 and the second compiled with D2005.  The sample application simply populates the combo box items, displaying the content in the first memo.  The second memo is populated when the Execute button is pressed.  The currently selected combo item (ItemIndex) also seems to get lost in some cases, but that needs further investigation and I suspect the two issues are related.

I have prepared a simple project to demonstrate the problem.
Steps to Reproduce:
Create a new Win32 Forms application
Add a new form
Add a TComboBoxEx to the form, a button, and two memos
In the FormCreate method
  Add items to the ComboBoxEx with some (not nil) values in the Data property
  Iterate through the ComboBoxEx items and display the Data property in the first memo
In the Button OnClick method
  Iterate through the ComboBoxEx items and display the Data property in the second memo
In the first form, add a button
In the Button's OnClick method, display the second form with ShowModal

Run the application
Click on the first form's button
See the first memo populated with the correct data values
Click on the button
See the second memo populated with zero data values
Workarounds
None
Attachment
comboboxex.zip
Comments

None

Server Response from: ETNACODE01