It is Windows Form.
My ExternalApplication has this code;
public Result OnStartup(UIControlledApplication application)
{
string panelName = "Test Panel";
RibbonPanel panel = application.CreateRibbonPanel(panelName);
string thisAssemblyPath = Assembly.GetExecutingAssembly().Location;
Image img = Properties.Resources.Image32;
ImageSource imgsrc=GetImageSource(img);
PushButtonData buttonData = new PushButtonData(
"cmdTestCommand",
"Testing Command",
thisAssemblyPath,
"NewTest.TestingCommand"
)
{
ToolTip = "Tooltip appears here....",
LongDescription = "This is a long description......",
Image = imgSrc,
LargeImage =imgSrc
};
PushButton pushButton = panel.AddItem(buttonData) as PushButton;
ContextualHelp cxtHelp = new ContextualHelp(ContextualHelpType.ChmFile,
Path.Combine(Path.GetDirectoryName(thisAssemblyPath), "TestCommandHelp.chm"));
pushButton.SetContextualHelp(cxtHelp);
return Result.Succeeded;
}
private BitmapSource GetImageSource(Image img)
{
BitmapImage bmp = new BitmapImage();
using (MemoryStream ms = new MemoryStream())
{
img.Save(ms, ImageFormat.Png);
ms.Position = 0;
bmp.BeginInit();
bmp.CacheOption = BitmapCacheOption.OnLoad;
bmp.UriSource = null;
bmp.StreamSource = ms;
bmp.EndInit();
}
return bmp;
}
When I hover the button, the tool tip is shown. Even the F1 opens CHM file. But as soon as the tooltip pops up, the Output window of visual studio show this error;
system.windows.media.animation warning: 6 : unable to perform action because the specified storyboard was never applied to this object for interactive control.
Then if I click the button, nothing is executed...