CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C++ Builder >  基础类

listbox怎么用?(在线等)

楼主jfei793(fisher)2002-09-14 19:47:44 在 C++ Builder / 基础类 提问

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

相关问题

  • combo listbox怎么用?
  • 如何用listbox?在线等。
  • 这个功能用listbox控件怎么实现??
  • 怎么用JavaScript实现ListBox的添加移除项功能
  • 用两个listbox怎么实现互相传值啊?
  • 使用Items.Add给ListBox加项时怎么设置对应的value
  • WIN FORM中怎么向LISTBOX中用程序动态添加项
  • Listbox里的items里的 Delimiter 是怎么用的
  • 请问我用listbox绑定了一个表的的字段NO,怎么记录不在listbox中显示呢?
  • 怎么设置Listbox!急!急!

关键词

  • listbox
  • filelistbox
  • itemindex
  • statbuf
  • 可见
  • items
  • list

得分解答快速导航

  • 帖主:jfei793
  • bigwhiteshark
  • zbc
  • bigwhiteshark
  • zbc
  • 40Star
  • signed
  • bufanxiong
  • gyj_china

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo