为什么我取不出ListBox里面的数据,请高手指教.
void CBox::Sum()
{
int i;
double t;
CString str="";
for(i=0;i<n;++i)
{
m_data.GetText(i,str);
t = atof((LPCTSTR)str);
d += t;
str.Empty();
}
str.Format("d = %0.15lf",d);
MessageBox(str);
}
m_data 为ListBox关联的变量,类型为CListBox
假如现在listbox里面有数据:
10.26
12.36
125.36
100.23
100.2659
现在问题就是d 始终为0.0000,实际上就是没有取到数据?急救!!!
{
int i;
double t;
CString str="";
for(i=0;i<n;++i)
{
m_data.GetText(i,str);
t = atof((LPCTSTR)str);
d += t;
str.Empty();
}
str.Format("d = %0.15lf",d);
MessageBox(str);
}
m_data 为ListBox关联的变量,类型为CListBox
假如现在listbox里面有数据:
10.26
12.36
125.36
100.23
100.2659
现在问题就是d 始终为0.0000,实际上就是没有取到数据?急救!!!
...全文
相关推荐
WPF listBox 漂亮的listBOX
WPF listBox 漂亮的listBOX
C#将ListBox数据导出到Excel中
注: lstboxNoOK 是ListBox控件的名称 TifFile 是一个实体类 /// /// 导出不合格数据 /// /// /// private void btnOutNumber_Click(object sender, EventArgs e) {
ListBox动态添加数据删除数据和上移下移
ListBox动态添加数据删除数据和上移下移, 无刷新。
用ListBox 显示数据库中的数据
visual studio 2008+Sqlserver 2005 主要是在Listbox中显示数据库中的内容 简单
wpf实现拖拽效果 把一个listbox中的一条数据放到另外一个listbox中
wpf实现拖拽效果实例 实现从一个listbox拖拽一条数据放到另外一个listbox中


