C++ Builder 二问:①DBChart显示慢②StringGrid去掉高亮
①我的access数据库大约有65000个数据,调入DBChart上显示一条曲线的时候,大约需要4秒钟。谁知道怎么才能快一些?注:即便设置DBChart分页显示,也不能减少时间。另外,我是用ADOQuery来做的。
②这个讨厌的StringGrid控件,程序一运行,就有一个单元格高亮(蓝色)显示,不太美观,虽然点击一下就没了,可是如果再点击别的控件就又有了。谁知道如何去掉高亮显示?
以上基于C++ Builder5.0
[解决办法]
这样已经有效果了,你看着改改就可以了
void __fastcall TForm1::DrawGrid1DrawCell(TObject *Sender, int Col, int Row, const TRect &Rect, TGridDrawState State){ long index = Row * StringGrid1->ColCount + Col; if( StringGrid1->Focused() ) StringGrid1->Canvas->Brush->Color = clBackground; else StringGrid1->Canvas->Brush->Color = clWhite; StringGrid1->Canvas->FillRect(Rect); if (State.Contains(gdFocused)) StringGrid1->Canvas->DrawFocusRect(Rect);}void __fastcall TForm1::FormCreate(TObject *Sender){ this->StringGrid1->OnDrawCell = DrawGrid1DrawCell ;}//---------------------------------------void __fastcall TForm1::StringGrid1Exit(TObject *Sender){ StringGrid1->Repaint(); }