Hi!
I'm writing a Database Editor / Bill of Materials Maker (2 separate .exe) for work, and I have this crazy issue. Here's how the flow works in the apps: Open Database, Search Database, Check Items Needed, Send to BOM Maker, Save as .xls.
So far, I can send checked Items to the BOM Maker, but only if I open the search window, check the items, without actually searching the List. Currently in the Search Form of the Database Editor, i have this loop:
for (int i = 0; i < rowCount; i++)
{
if (ResultBox1.Items[i].Checked == true)
{
//Code that creates .txt file to be loaded by the BOM Maker...
}
}
The loop works flawlessly, but only if i avoid using the search function. The Search Function does clear the ListView, and populate it with results, but why would that matter?
The error i get is:
InvalidArgument=Value of '22' is not valid for 'index'. Parameter name: index
'22' being the line I checked relative to the Array I use to populate the ListView from the start.
Unless i need to look into my Search Method, is there another way to perform this action? I'm useless at "foreach" loops, could anyone give me an opinion?
Thank you!