XCAD.NET
XCAD.NET
Framework for .NET (C# and VB.NET) to create modern application for CAD systems (SOLIDWORKS)
Get technical support Access source code Explore code and application examples

Bitmap button control and toggle in SOLIDWORKS property Manager Page


This control allows to assign image onto the button or toggle

Bitmap buttons and toggles
Bitmap buttons and toggles

  1. Button with bitmap
  2. Checked and unchecked toggles with bitmap
  3. Large button
  4. Standard images in the buttons

Button

Decorate the property of type Action with Xarial.XCad.UI.PropertyPage.Attributes.BitmapButtonAttribute in order to create bitmap button control.

[BitmapButton(typeof(Resources), nameof(Resources.BitmapSample))]
public Action Button1 { get; set; } = new Action(()=> { });

Toggle

Decorate the property of type bool with Xarial.XCad.UI.PropertyPage.Attributes.BitmapButtonAttribute in order to create bitmap toggle control.

[BitmapButton(typeof(Resources), nameof(Resources.BitmapSample))]
public bool Toggle1 { get; set; } = false;

[BitmapButton(typeof(Resources), nameof(Resources.BitmapSample))]
public bool Toggle2 { get; set; } = true;

Size

Default size of the button is 24x24 pixels. Use the width and height parameters of the constructor to assign custom size.

[BitmapButton(typeof(Resources), nameof(Resources.BitmapSample), 48, 48)]
public Action Button2 { get; set; } = new Action(() => { });

Standard

Use constructor overload to specify standard bitmap for the button.

[BitmapButton(Xarial.XCad.UI.PropertyPage.Enums.BitmapButtonLabelType_e.AlongZ)]
public bool Standard1 { get; set; }

[BitmapButton(Xarial.XCad.UI.PropertyPage.Enums.BitmapButtonLabelType_e.Draft)]
public bool Standard2 { get; set; }

Standard icons for bitmap button
Standard icons for bitmap button

  1. AlongZ
  2. Angle
  3. AutoBalCircular
  4. AutoBalLeft
  5. AutoBalRight
  6. AutoBalSquare
  7. AutoBalTop
  8. Diameter
  9. Distance1
  10. Distance2
  11. Draft
  12. DveButCmarkBolt
  13. DveButCmarkLinear
  14. DveButCmarkSingle
  15. LeaderAngAbove
  16. LeaderAngBeside
  17. LeaderHorAbove
  18. LeaderHorBeside
  19. LeaderLeft
  20. LeaderNo
  21. LeaderRight
  22. LeaderYes
  23. Parallel
  24. Perpendicular
  25. ReverseDirection
  26. RevisionCircle
  27. RevisionHexagon
  28. RevisionSquare
  29. RevisionTriangle
  30. StackLeft
  31. StackRight
  32. StackUp
  33. Stack
  34. FavoriteAdd
  35. favoriteDelete
  36. FavoriteSave
  37. FavoriteLoad
  38. DimensionSetDefaultAttributes

Powered by Docify