2009-04-03 79 views
0

私は.NETアプリケーションを開発しています。そして、いくつかのVB6コモンコントロール私がイメージリストを作成し、制御 をツールバーにそれを添付することができ、デザインモードで(プログラムで)AxMSComctlLib.AxImageListにイメージを追加し、AxMSComctlLib.AxToolbarにバインドされたイメージリストを追加する方法

が、私はプログラム的にツールバーのボタン

を追加している使用して

Toolbar.Buttons.Add(「TBSAVE」、 "保存それはすべてのアイデア

ではありません "無効なキー」、MSComctlLib.ButtonStyleConstants.tbrDefault、toolbarImages.ListImages(1).Picture)を

は例外を取得します"? ありがとう

答えて

1

あなたは.NETで考えています。代わりにVB6で考える。

dim nIndex as long 
nIndex = 4 ' this is the index of your image in the ImageList control. 
      ' The code assumes that you already assigned the ImageList 
      ' to the Toolbar.ImageList property 

Toolbar.Buttons.Add(, "tbsave", "Save", MSComctlLib.ButtonStyleConstants.tbrDefault, nIndex) 
関連する問題