社区
Office开发/ VBA
帖子详情
请教如何才能让combobox的数据项全部清空。急急!!!
gbz
2003-06-16 02:11:29
请给出实例。。。
...全文
1027
4
打赏
收藏
请教如何才能让combobox的数据项全部清空。急急!!!
请给出实例。。。
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
longji
2003-06-25
打赏
举报
回复
ComboBox1.Text=""也可以!
zfzfzf
2003-06-21
打赏
举报
回复
ComboBox1.clear
gbz
2003-06-19
打赏
举报
回复
老大我要的是简单的清空数据项(列表项)就行了,不明白!
longji
2003-06-16
打赏
举报
回复
组合框控件、AddItem 方法、Picture 和 PicturePosition 属性示例
下例用组合框来显示控件的图片位置选项。每次用户单击列表选项,命令按钮上的图片和题注都将被更新。这个代码示例还使用了 AddItem 方法来固定组合框选项。
若要使用该示例,请将示例代码复制到某窗体的声明变量部分。请确保该窗体包含:
名为 Label1 的标签。
名为 CommandButton1 的命令按钮。
名为 ComboBox1 的组合框。
Private Sub UserForm_Initialize()
Label1.Left = 18
Label1.Top = 12
Label1.Height = 12
Label1.Width = 190
Label1.Caption = "Select picture placement " _
& "relative to the caption."
'把列表条目加入组合框。每一
'条目的值符合组合框中
'对应的 ListIndex 的值。
ComboBox1.AddItem "Left Top" 'ListIndex = 0
ComboBox1.AddItem "Left Center" 'ListIndex = 1
ComboBox1.AddItem "Left Bottom" 'ListIndex = 2
ComboBox1.AddItem "Right Top" 'ListIndex = 3
ComboBox1.AddItem "Right Center" 'ListIndex = 4
ComboBox1.AddItem "Right Bottom" 'ListIndex = 5
ComboBox1.AddItem "Above Left" 'ListIndex = 6
ComboBox1.AddItem "Above Center" 'ListIndex = 7
ComboBox1.AddItem "Above Right" 'ListIndex = 8
ComboBox1.AddItem "Below Left" 'ListIndex = 9
ComboBox1.AddItem "Below Center" 'ListIndex = 10
ComboBox1.AddItem "Below Right" 'ListIndex = 11
ComboBox1.AddItem "Centered" 'ListIndex = 12
'使用下拉列表
ComboBox1.Style = fmStyleDropDownList '组合框值是 ListIndex 值
ComboBox1.BoundColumn = 0
'把组合框设置为第一个条目
ComboBox1.ListIndex = 0
ComboBox1.Left = 18
ComboBox1.Top = 36
ComboBox1.Width = 90
ComboBox1.ListWidth = 90
'初始化 CommandButton1
CommandButton1.Left = 230
CommandButton1.Top = 36
CommandButton1.Height = 120
CommandButton1.Width = 120
'注意:确认引用的位图文件是
'存在于系统中的,并在
'文件名中包括路径
CommandButton1.Picture = _
LoadPicture("c:\windows\argyle.bmp")
CommandButton1.PicturePosition = ComboBox1.Value
End Sub
Private Sub ComboBox1_Click()
Select Case ComboBox1.Value
Case 0 '上左
CommandButton1.Caption = "Left Top"
CommandButton1.PicturePosition = _
fmPicturePositionLeftTop
Case 1 '中左
CommandButton1.Caption = "Left Center"
CommandButton1.PicturePosition = _
fmPicturePositionLeftCenter
Case 2 '下左
CommandButton1.Caption = "Left Bottom"
CommandButton1.PicturePosition = _
fmPicturePositionLeftBottom
Case 3 '上右
CommandButton1.Caption = "Right Top"
CommandButton1.PicturePosition = _
fmPicturePositionRightTop
Case 4 '中右
CommandButton1.Caption = "Right Center"
CommandButton1.PicturePosition = _
fmPicturePositionRightCenter
Case 5 '下右
CommandButton1.Caption = "Right Bottom"
CommandButton1.PicturePosition = _
fmPicturePositionRightBottom
Case 6 '左上
CommandButton1.Caption = "Above Left"
CommandButton1.PicturePosition = _
fmPicturePositionAboveLeft
Case 7 '中上
CommandButton1.Caption = "Above Center"
CommandButton1.PicturePosition = _
fmPicturePositionAboveCenter
Case 8 '右上
CommandButton1.Caption = "Above Right"
CommandButton1.PicturePosition = _
fmPicturePositionAboveRight
Case 9 '左下
CommandButton1.Caption = "Below Left"
CommandButton1.PicturePosition = _
fmPicturePositionBelowLeft
Case 10 '中下
CommandButton1.Caption = "Below Center"
CommandButton1.PicturePosition = _
fmPicturePositionBelowCenter
Case 11 '右下
CommandButton1.Caption = "Below Right"
CommandButton1.PicturePosition = _
fmPicturePositionBelowRight
Case 12 '中
CommandButton1.Caption = "Centered"
CommandButton1.PicturePosition = _
fmPicturePositionCenter
End Select
End Sub
Python 寄存器位域解析与 JSON 配置工具(芯片开发+寄存器/位域+解析源码+寄存器转储分析)
根据 JSON 指定位宽和字段起止位,解析寄存器数值并显示枚举含义。包含重叠字段、重复名称、位范围和输入数值检查。 适用于嵌入式软件开发人员、驱动开发入门者及相关技术学习者。资源包含源码或模板、使用说明及验证范围说明。Python 3.10+,仅使用标准库;寄存器宽度 1 至 64 位。 功能边界见 README.md,实际验证情况见 TESTING.md。
MATLAB实现的两级OPF与电动车充电调度,用于配电网络.zip
1.版本:matlab2014a/2019b/2024b 2.附赠案例数据可直接运行。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
UAC白名单设置-软件使用
代码下载链接: https://pan.quark.cn/s/a4b39357ea24 用户账户控制(UAC)白名单的配置 Windows7环境中 UAC(User Account Control,用户帐户控制)是由微软在Windows Vista版本中推出的一项旨在增强系统安全性的创新技术,该技术强制要求用户在执行可能干扰计算机正常运作的操作或进行更改会波及其他用户设置的变动前,必须提供相应的权限或管理员密码进行验证。通过对这些操作启动前进行授权确认,UAC能够有效阻止恶意软件及间谍软件在未获授权的状态下于计算机内进行安装或实施修改。 自从Vista版本问世以来,微软便开始推行这一全新的安全机制,可视为对系统安全防护的显著提升。尽管UAC确实能够在一定程度上对某些非法程序起到防御作用,但与此同时,这一功能也给众多用户带来了诸多不便。 因此,许多用户开始探寻是否存在类似于白名单的功能,以便将那些值得信赖的程序直接赋予运行权限。事实上,这类功能确实存在,不过微软并未将其作为标准配置提供。 网络上关于此问题的绝大多数建议都是建议禁用UAC,这种说法显然缺乏针对性,因为若用户希望禁用此功能,本就不会提出相关疑问。 通过运用微软官方发布的Microsoft Application Compatibility Toolkit 5.6版本,可以将信任的程序纳入系统白名单范畴。 获取Application Compatibility Toolkit 安装程序成功后会出现三个可执行文件 以管理员身份启动Compatibility Administrator 在Custom DataBases部分创建新的数据库,并添加一个Application Fix(在下方空白处点击右键,选择...
Office开发/ VBA
5,174
社区成员
17,906
社区内容
发帖
与我相关
我的任务
Office开发/ VBA
其他开发语言 Office开发/ VBA
复制链接
扫一扫
分享
社区描述
其他开发语言 Office开发/ VBA
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章