不知为何打不上断点,总之是很痛苦的,这两日遇上些麻烦,也总之如下,有关 HashTable,有关 FpSpread,有关 ListBox
HashTable ht(key,value)
- key 值重复会报错!
错误为:“未将对象引用设置到对象的实例”
FpSpread fp,fp_sheet1
- 注意,容易在参数为变量时出错:
fp.AddRows(int row,int count),其中 count 不能为 0
- 想找到 fp 中活动的行,可以用:
fp_sheet1.ActiveRow.Index
fpSpread_Sheet1.ActiveRowIndex
- 设置活动单元格,可以用
fp_sheet1.SetActiveCell(int row,int column)
ListBox lb
- 在 ListBox 中,点击 Item 事件需自己定义,其中若遇麻烦可尝试以下写法:
int index = lb.IndexFromPoint(e.Location);//e 为鼠标事件参数
if (index != System.Windows.Forms.ListBox.NoMatches)
{
//NoMatches:指定在搜索过程中没有找到匹配项
//todo
}