c# addin : button icon

c# addin : button icon

WillyPoelmans3643
Participant Participant
1,088 Views
3 Replies
Message 1 of 4

c# addin : button icon

WillyPoelmans3643
Participant
Participant

Hello,

 

I'm searching for quiet a while now, but I can't find information or an example to show an Icon (image) in a button on the shelf for my new tools. The addin should run on 64bit windows. 

I found some example wich use vb6 tools, but I don't have these on my win64 and c#.

 

Maybe I have been overlooking the solution, but does anyone has a piece of example-code to show how to add an icon to a button?

 

Thanks,

Willy

 

0 Likes
1,089 Views
3 Replies
Replies (3)
Message 2 of 4

YuhanZhang
Autodesk
Autodesk

Maybe you want to see a sample in the SDK for how to add icon to a button, you can find it in:\SDK\DeveloperTools\Samples\VCSharp.NET\AddIns\SimpleAddIn. You have to install the DeveloperTools.msi first. You can find the SDK installer from:

 

Win7/Vista: C:\Users\Public\Documents\Autodesk\Inventor <version>\SDK

WinXP: <Inventor install folder>\SDK



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 4

WillyPoelmans3643
Participant
Participant

Hello,

 

Thank you for your response, I have tried the example that you mention, but the issue that I have is that it uses Microsoft.VisualBasic.Compatibility.VB6.Support.IconToIPicture(System.Drawing.Icon)

But that is not supported on windows 64 bit, that's also the error message that I get : 

 

Warning 3 'Microsoft.VisualBasic.Compatibility.VB6.Support.IconToIPicture(System.Drawing.Icon)' is obsolete: '"Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. 

 

How do other programmers use an icon on their buttons for addons? It must be possible to do so, no?

 

Thanks

Regards,

Willy

 

0 Likes
Message 4 of 4

YuhanZhang
Autodesk
Autodesk

Currently you can just ignore the warning, it won't block building the project.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes