2009-04-03 2 views
0

Ich entwickle .NET App. und mit einigen VB6 gemeinsame KontrollenWie Sie (programmatisch) Bilder zu AxMSComctlLib.AxImageList und gebundene Bildliste zu AxMSComctlLib.AxToolbar hinzufügen

im Entwurfsmodus kann ich Bildliste erstellen und befestigen sie die Steuerung an Symbolleiste aber wenn ich hinzufüge, programmatisch Schaltflächen

Toolbar.Buttons.Add („tbsave“, " speichern“, MSComctlLib.ButtonStyleConstants.tbrDefault, toolbarImages.ListImages (1) .Picture)

get Ausnahme "Invalid Key" Es ist nicht

Jede Idee ?? Danke

Antwort

1

Sie denken in .NET. Denke stattdessen an 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) 
Verwandte Themen