how to display image in parameterinfo

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Karl Grambow
Version: 4.0.0232
Avatar
Hi,

I'm trying to figure out how to display an image inside an InfoTip but cannot figure it out. In the sample app, inside the SimpleSyntaxLanguage class you use the following inside the GetQuickInfoForFunctionDeclaration method.

result.Append("<img src=""resource:PublicMethod"" align=""absbottom""/> ") 
I assume that's where you load the image. However, I don't quite follow what's happening here. What is resource:PublicMethod? And, more importantly, how and where do you tell it what that image is?

Note that I'm not using a language class when loading my language, I'm just loading it straight from the XML file using SyntaxDocument.LoadLanguageFromXml (not sure if that makes a difference). Also, all of my icons/images are embedded resources (again, not sure if that makes a difference).

By the way, cool changes on the forum. Oh, and if I haven't mentioned it before, this product is just awesome.

Thanks,

Karl

Comments (2)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Karl,

For the "src" attribute, you can specify "resource:something" to use images from the built-in ReflectionImageList. All those valid names are in the ActiproSoftware.Products.SyntaxEditor.IconResource enumeration (e.g. PublicProperty).

If you want to do a custom Image, you can set the "src" to anything other than a value starting with "resource:". Then the SyntaxEditor.IntelliPromptTipImageRequested event (also SyntaxLanguage.OnSyntaxEditorIntelliPromptTipImageRequested) is called. In one of those you can handle the event args and supply an Image based on the "src" that you specified. So here is where you would load your appropriate resource Image and pass it back.

Thanks for the forum comments... we did some cool things the past couple days to improve them. It's nice to see people notice! :)


Actipro Software Support

Posted 18 years ago by Karl Grambow
Avatar
Thanks,

That's perfect! The custom image is what I wanted.

Karl
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.