我在 Outlook 中有一个自定义按钮,我必须为同一个按钮添加图像图标。
功能区 XML 是:
<button id="GoToAppConfiguration"
label="Application Configuration"
getImage="GetCustomImage"
onAction="GoToAppConfigurationClicked"
size="normal" />
我想编写功能区回调方法,但如何编写相同的方法以及如何使用存储在 Addin 项目下 Resource 文件夹中的图像。
最佳答案
你只需要返回一个 Bitmap
来自 GetCustomImage
。这是一个 c# 示例,假设您已将 BMP 添加到您的 Project Resources .
public Bitmap GetCustomImage(Office.IRibbonControl control)
{
return Properties.Resources.btnAppConfiguration_Image; // resource Bitmap
}
关于c# - 如何在 Outlook 中为自定义按钮添加图像图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10350211/