TabControl.SetImageList error |
Post Reply |
Author | |
Majek
Groupie Joined: 20 November 2006 Status: Offline Points: 24 |
Post Options
Thanks(0)
Posted: 21 November 2006 at 5:00pm |
I'm trying to display 16x16 images from an ImageList on a TabControl, I have 12 tabs and 12 images in the Imagelist.
(TC=TabControl, IL=ImageList) With TC
.SetImageList(IL) .InsertItem(0, "Play", 0, 0) .InsertItem(1, "Stop", 0, 1) .InsertItem(2, "Pause", 0, 2) .InsertItem(3, "Resume", 0, 3) .InsertItem(4, "Back", 0, 4) .InsertItem(5, "Next", 0, 5) .InsertItem(6, "Random", 0, 6) .InsertItem(7, "Continuous", 0, 7) .InsertItem(8, "Reverse", 0, 8) .InsertItem(9, "Repeat", 0, 9) .InsertItem(10, "Shuffle", 0, 10) .InsertItem(11, "Queue", 0, 11) .InsertItem(12, "Info", 0, 12) End With When I run it it returns this exception:
System.InvalidCastException: No such interface supported at System.Runtime.InteropServices.Marshal.GetIDispatchForObject(Object o) at System.Runtime.InteropServices.DispatchWrapper..ctor(Object obj) at System.RuntimeType.WrapArgsForInvokeCall(Object[] aArgs, Int32[] aWrapperTypes) at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) at XtremeSuiteControls._DTabControl.SetImageList(Object ImageList) at AxXtremeSuiteControls.AxTabControl.SetImageList(Object imageList) at WindowsApplication1.frmMain.frmMain_Load(Object sender, EventArgs e) Am I doing something wrong?
|
|
Majek
Groupie Joined: 20 November 2006 Status: Offline Points: 24 |
Post Options
Thanks(0)
|
make that 13 tabs
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
When you call SetImageList you must use ActiveX vesion of mscommCtrl imagelist (I think you try managed vesion now). Better use our ImageMnager control or load icons using TabControl.Icons property.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Majek
Groupie Joined: 20 November 2006 Status: Offline Points: 24 |
Post Options
Thanks(0)
|
Ohh okay thanks I see now. I wanted to use the ImageManager in the first place I just didnt know how.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |