Sep 03

如何在 VB6 中用代码按下 Toolbar 上的按钮

可用所需要按下按钮的名字和索引即可。如 Toolbar 控件的名字为 Toolbar1,需要按下的按钮的名字(Caption)属性为Test,索引(Index)属性是1,代码如下:
1. 用名字
Call Toolbar1_ButtonClick(Toolbar1.Buttons("Test"))
Toolbar1.Buttons("Test").Value = tbrPressed

Call Toolbar1_ButtonClick(Toolbar1.Buttons(1))
Toolbar1.Buttons(1).Value = tbrPressed

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>