如何在VB程序中添加imagelist,toolbar这两个控件?

如何在VB程序中添加imagelist,toolbar这两个控件?,第1张

这两个控件一般是组合起来,用来制作工具栏按钮的.

imagelist可以自己通过属性页来添加图象,或是使用

imagelist1.listimages.add

指令来增加图象.

dim

imgx

as

listimage

'将图片加载到

imagelist

控件中。

set

imgx

=

imagelist1.listimages.

_

add(,

"文字",

loadpicture("图象.bmp"))

而后可以在toolbar里面使用.

在toolbar里面可以通过属性页来添加按钮..

也可以用

set

btnx

=

toolbar1.buttons.add(,

"open",

,

tbrdefault,

"open")

来增加按钮

在使用toolbar时先把

属性页里面的图象列表改成imagelist的控件名..

之后再属性页添加按钮时就可以设置图象

数值1就是代表imagelist里面的第一个图.

最后..

可以在toolbar的buttonclick事件里书写代码.

比如..

private

sub

toolbar1_buttonclick(byval

button

as

mscomctllib.button)

msgbox

button.index

end

sub

在这里点击了工具栏按钮之后就显示了.点击的是第几个按钮..

select

case

button.index

case

1

msgbox

"第一"

case

2

msgbox

"第二"

end

select

您好,我来为您解答:

既然是UIWebView,不如把对应的Web用Bootstrap写,达到你的效果

你们项目的 Layout 工具是什么?如果用 AutoLayout 那么加上一个bottom leading trailing 的 constraint 就可以了啊。如果是手写代码,那就设置 frame 为 (0,view.height-44,view.width,44)就可以了。

话说为什么不用 xib 呢,用 xib 根本不用写代码就能解决你的问题了。

希望我的回答对你有帮助。

使用ToolBar控件的方法:

拖拽CommandDock控件到窗体,它给Toolbar提供停靠和浮动,然后拖拽ToolBar控件到CommandDock,这是一个表示工具栏的控件。就像MainMenu控件一样,它也包含了一系列的命令链接。CommandDock可以添加不同的多个Toolbar。代码参考如下:

this.c1CommandDock1.Controls.Add(this.c1ToolBar_Tools)

this.c1CommandDock1.Controls.Add(this.c1ToolBar_Format)

this.c1CommandDock1.Controls.Add(this.c1ToolBar_Edit)

this.c1CommandDock1.Controls.Add(this.c1ToolBar_File)

详细的实现方法,可以参考下面的博客

http://blog.gcpowertools.com.cn/post/2014/05/22/C1MenusToolbars-Overview.aspx


欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/bake/11421262.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-16
下一篇 2023-05-16

发表评论

登录后才能评论

评论列表(0条)

保存