新手跪地求教~!(50分)

  • 主题发起人 主题发起人 skima
  • 开始时间 开始时间
S

skima

Unregistered / Unconfirmed
GUEST, unregistred user!
我现在在做一个VOD视频点播系统.(新手,基本上刚接触DELPHI)
差不多末期了.
现碰到一个问题,就是当我在DBGIRD里调出一张表后(其实就是一条条歌名的记录),
怎么样才能在点击一个记录后,把这个记录存放到LISTBOX里?(就是VOD中把歌曲加入播放列表的意思)
请教各位高手啊~!
 
procedure TFrmmagcard.DBGrid1CellClick(Column: TColumn);
begin

listbox1.items.add(DBGrid1.DataSource.DataSet.FieldByName('歌曲名').AsString);
end;
 
en,动态 添加列表!
 
TO:APPP2001谢啦,可以..
不过还有点小小的疑问.
删除LISTBOX里的某一条记录该怎么做?^_^
 
以后千万别下跪,dfw可受不起,何况男儿膝下有黄金!
测试一下
TlisBox.ClearSelection;

Deselects all selected items in the list box, if possible.

procedure ClearSelection;

Description

Use ClearSelection to deselect all the currently selected items in the list box. When the list box receives focus, after ClearSelection is called, the last item that was selected is the item that receives the current focus in the list box. Although this item receives focus, the item itself is not selected.
 
如果以上不行的话,还可以试试这个:
TlistBox.Items.Delete(i)

Introduces an abstract method to delete a specified string from the list.

procedure Delete(Index: Integer);
virtual;
abstract;

Description

Descendants of TStrings implement a Delete method to remove a specified string from the list. If an object is associated with the string, the reference to the object is removed as well. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on.
 
不用这么悲壮吧.
高手们也不至于麻木到非要你跪地的程度吧.
 
listbox.DeleteSelected
 
多人接受答案了。
 

Similar threads

回复
0
查看
1K
不得闲
D
回复
0
查看
802
DelphiTeacher的专栏
D
D
回复
0
查看
747
DelphiTeacher的专栏
D
D
回复
0
查看
744
DelphiTeacher的专栏
D
后退
顶部