listbox怎么用?(在线等)
listbox可以做下拉的菜单。在什么地方做啊?请高手们指教 问题点数:20、回复次数:10Top
1 楼bigwhiteshark(变性鲨鱼)回复于 2002-09-14 19:56:09 得分 1
读取
ShowMessage(ListBox1->Items->Strings[ListBox1->ItemIndex]);
写入
ListBox1->Items->Add("ss");Top
2 楼zbc(修身养息,百战不怠)回复于 2002-09-14 19:58:58 得分 2
设置它的items属性就可以得到下拉的了Top
3 楼bigwhiteshark(变性鲨鱼)回复于 2002-09-14 21:38:31 得分 4
ListBox1->Items->Append( OpenPictureDialog1->FileName);
ListBox1->Items->Delete(ListBox1->ItemIndex);
ListBox1->Items->Move(ListBox1->ItemIndex,ListBox1->ItemIndex-1);
ComboBox1->Text=ComboBox1->Items->Strings[0];
ListBox1->ItemIndex //是选中的索引
ListBox1->TopIndex=0;
组件分为三种
可见
TButtion
不可见有图标
TADOContion
不可见无图标
TStringStreamTop
4 楼jfei793(fisher)回复于 2002-09-16 19:26:24 得分 0
选中下拉的菜单中一项有单击事件或什么来触发它吗?Top
5 楼zbc(修身养息,百战不怠)回复于 2002-09-16 19:45:25 得分 2
是的,选中一项会发生单击事件的Top
6 楼jfei793(fisher)回复于 2002-09-16 19:49:21 得分 0
可是这个单击事件在哪编程啊?Top
7 楼40Star(斯文、大方、有前途)回复于 2002-09-16 20:03:45 得分 4
popupmenu中指定Top
8 楼signed()回复于 2002-09-16 21:14:29 得分 2
看在线帮助嘛,朋友Top
9 楼bufanxiong(bufanxiong)回复于 2002-09-16 21:26:16 得分 4
给个联机帮助看:
This example uses a file listbox and a regular listbox on a form. The following routine scans through the files listed in the file listbox and lists the sizes of any selected files to the regular list box:
for (int i = 0; i < FileListBox1->Items->Count; i++)
{
if (FileListBox1->Selected[i])
{
if (!FileExists(FileListBox1->Items->Strings[i]))
{
MessageBeep(0);
if (Application->MessageBox(AnsiString("File ") + FileListBox1->Items->Strings[i] + " not found",NULL, MB_OKCANCEL | MB_DEFBUTTON1) == IDCANCEL)
break;
else
continue;
}
FILE *F = fopen(FileListBox1->Items->Strings[i].c_str(),"r");
struct stat statbuf;
fstat(fileno(F), &statbuf);
ListBox1->Items->Add(IntToStr(statbuf.st_size));
fclose(F);
}
}Top
10 楼gyj_china(透明)回复于 2002-09-16 21:46:58 得分 1
在ListBox的单击事件可以写在它的OnClick里面啊。Top




