I had a listbox that was in a separate window (drawer) and I decided to move it into the main window for better usability on Windows. It was a standard Listbox, not a subclass.

In the main window, I made my own class, myListBox, to hold some of the logic and params that had been in the parent window before. Both original and subclass had the column widths set to "0,*,0".

I had the following code to add data which worked fine:

    // Display rule in Rule list box
    RulesWin.RulesList.AddRow(Str(newRule.id))
RulesWin.RulesList.cell(RulesWin.RulesList.LastIndex, 1) = newRule.displayRule RulesWin.RulesList.cell(RulesWin.RulesList.LastIndex, 2) = newRule.desc


Now that the Listbox is in the main window, I added the following lines to be:
        
    // Display rule in Rule list box
    self.RulesList.AddRow(Str(newRule.id))
self.RulesList.cell(self.RulesList.LastIndex, 1) = newRule.displayRule
    self.RulesList.cell(self.RulesList.LastIndex, 2) = newRule.desc

The data is added, but it's not displayed, it doesn't "paint" in the listbox. The row is added because I can select it, and if I double- click it it displays it's contents in a MsgBox (added to verify/debug).

In testing, I found that the following did cause the text to display when added. But throughout the life of the app I can't guarantee that the rule id will always be the index of the last row added.

    self.RulesList.cell(newRule.id, 1) = newRule.displayRule
    self.RulesList.cell(newRule.id, 2) = newRule.desc

Any idea why the subclass isn't displaying the data when added? I did not do anything with the subclass except give it some properties to hold state data and added some things in the open event to set that data.

Steve
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to