请教一个listbox选择的问题,谢谢了
两个问题,
1.我的ListBox1为什么不能点击啊,我把每个数据添加到listbox,我想选择啊,
2.我想把一个edit绑定Datasource,怎么不行呀,
//edt1->DataSource = DataSourceSubject;
//edt1->DataField = "title";
TADODataSet *ADODataSetMax=new TADODataSet(NULL);
ADODataSetMax->Connection = ADOConnection;
ADODataSetMax->Close();
ADODataSetMax->CommandText = "select title from subject where agendaid = '"+ IntToStr(agendaid) +"'";
ADODataSetMax->Open();
ListBox1->Clear();
while (!ADODataSetMax->Eof)
{
ListBox1->Items->Add(ADODataSetMax->FieldByName("title")->AsString);
ADODataSetMax->Next();
}
TDataSource *DataSourceSubject = new TDataSource(this);
DataSourceSubject->DataSet = ADODataSetMax;
//绑定标题
//edt1->DataSource = DataSourceSubject;
//edt1->DataField = "title";
ListBox1->DataSource = DataSourceSubject;