Hide Table of Contents
AddCustomButton2 Method (ITaskpaneView)

Adds a custom button to the Task Pane.

.NET Syntax

Visual Basic (Declaration) 
Function AddCustomButton2( _
   ByVal ImageList As System.Object, _
   ByVal ToolTip As System.String _
) As System.Boolean
Visual Basic (Usage) 
Dim instance As ITaskpaneView
Dim ImageList As System.Object
Dim ToolTip As System.String
Dim value As System.Boolean
 
value = instance.AddCustomButton2(ImageList, ToolTip)
C# 
System.bool AddCustomButton2( 
   System.object ImageList,
   System.string ToolTip
)
C++/CLI 
System.bool AddCustomButton2( 
&   System.Object^ ImageList,
&   System.String^ ToolTip
) 

Parameters

ImageList
Array of strings for the paths for the image files for the custom button (see Remarks)
ToolTip
ToolTip for the custom button

Return Value

True if the custom button is added to the Task Pane, false if not

Remarks

This method supports scaling for high resolution screens with high resolution operating system scaling options.

ImageList images can be:

  • 20 x 20 pixels
  • 32 x 32 pixels
  • 40 x 40 pixels
  • 64 x 64 pixels
  • 96 x 96 pixels
  • 128 x128 pixels 

The images should use 256-color palette.

The size of the custom button displayed is dictated by both the monitor's or laptop's screen resolution and SOLIDWORKS icon size. You must set the custom button size before executing a macro or application that calls this method. 

For example, if running Windows 7:

  1. To set your monitor's or laptop's screen resolution:
    1. Click Start > Control Panel > Appearance and  Personalization > Display.
    2. Select a different icon size.
    3. Click Apply.
    4. Click Log off now.
  2. Log back in.
  3. Start SOLIDWORKS and open a part, assembly, or drawing.
  4. Click Tools > Customize and on the Toolbars tab, click the Icon size that matches the size that you set in step 1b and click OK two twice.
 

See Also

Availability

SOLIDWORKS 2016 FCS, Revision Number 24.0


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   AddCustomButton2 Method (ITaskpaneView)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2019 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.