DBGrid的onMouseWheelDown,onMouseWheelUp,onMouseWheel事件
我在onMouseWheel取值
Memo1->Lines->Add("MouseWheel:"+Query1->Fields->Fields[1]->AsString+"; "+Query1->Fields->Fields[0]->AsString );
发现取出来都是上一行或是下一行的值,
怎么能取出当前行的值,,,
谢谢
[解决办法]
安装Eh组件,然后使用dbgrid这个控件支持鼠标滚轮。
void __fastcall TForm1::ADOQuery1AfterScroll(TDataSet *DataSet)
{
if( DBGridEh1->DataSource->DataSet->Active )
this->Edit2->Text = this->DBGridEh1->DataSource->DataSet->Fields->Fields[0]->AsString;
}