Print Page | Close Window

TabControl.SetImageList error

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=5573
Printed Date: 17 November 2024 at 5:33am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TabControl.SetImageList error
Posted By: Majek
Subject: TabControl.SetImageList error
Date 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?



Replies:
Posted By: Majek
Date Posted: 22 November 2006 at 1:36am
make that 13 tabs


Posted By: Oleg
Date Posted: 22 November 2006 at 1:53am
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


Posted By: Majek
Date Posted: 24 November 2006 at 10:55am
Ohh okay thanks I see now. I wanted to use the ImageManager in the first place I just didnt know how.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net