我正试图在Windows 7.的银星号中添加“强硬”。 我想这些插图出现在固定的宽度栏目中,而名单Box则在名单Box开始新行时想进。 此外,在用户点击纽子时,在名单Box中增加一个字。 我尝试使用瓦解弹片,但是这并不允许 view。 现在,我的目前解决办法是有效的,但指数操作者给我一个指数,以排除约束错误,而插入方法使我重复下行的条目......
我试图使用插入方法或指数操作者(显然不是两者兼有)一样:
this.wordListBox.Items.Insert(numRows, formatRow);
this.wordListBox.Items[numRows] = formatRow;
This is an idea of the flow of my program, Example: The user clicks a button and a Word is concatenated to the presently null formatRow and formatRow is added to the wordListBox at numRows which is presently 0. The button is clicked again and another word is concatenated to formatRow and formatRow is added to the wordListBox at numRows which is still 0. Thus, I now have the first element of wordListBox set to a string that contains two words. This repeats until 5 words have been added to formatRow and then, numRows is incremented and formatRow is set to null. Now, words will be added to the next row in the wordListBox, and the wordListBox will scroll into view because each element of the ListBox will be one string.
Can anyone point out my error with the insert method of index operator or show me how to make these functions work for my purposes? Also, If anyone needs a better explanation I will try my best to explain in more detail.