ComponentOne Menus and Toolbars for WinForms
Menus and Toolbars for WinForms Task-Based Help / ToolBar Tasks / Adding an Image to the Toolbar Button
In This Topic
    Adding an Image to the Toolbar Button
    In This Topic

    This topic assumes you have a toolbar button created. To add an image to your toolbar button in code, complete the following steps:

    1. Locate the command in your source file that you want to add an image to.

    2. Enter the following code to add an image to your toolbar button:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      cNew.Image = System.Drawing.Image.FromFile("C:\bitmap\New.bmp")
      

      To write code in C#

      C#
      Copy Code
      cNew.Image = System.Drawing.Image.FromFile("C:\\bitmap\\New.bmp");
      
    See Also