4 Replies Latest reply on Nov 5, 2008 2:11 PM by Lee Priest

    Property Manager Page

    Lee Priest
      Not sure if anyone has attempted this, but many of the Solidworks commands contain controls on the property manager page that have a bitmap button to the left of the control (say, for example, the 'Add Reference Geometry' function which contains a column of buttons on the left, each of which activates a different control to the right of it).

      I can't figure out how to do this. I know how to create bitmap buttons, but I just can't get them to appear on the same line as another control in the property manager page.

        • Property Manager Page
          Mike Spens
          you set it on the control itself. There are two options, either point to an external bitmap, or use a standard icon


          swControlBitmapLabelType_e is the enumeration of standard picture label types if you don't want to use your own bitmap.

          Here's a snippet of a sample from the API help...

          Set swControl = m_Group.AddControl(Id, controlType, _
          caption, alignment, options, tip)

          If Not swControl Is Nothing Then

          Set m_Selection = swControl

          filterArray(0) = swSelSOLIDBODIES

          filterArray(1) = swSelSURFACEBODIES

          m_Selection.SingleEntityOnly = True

          m_Selection.Height = 50

          m_Selection.SingleEntityOnly = True

          m_Selection.SetSelectionFilters (filterArray)

          m_Selection.SetStandardPictureLabel _

          End If
            • Property Manager Page
              Lee Priest
              Thanks for the reply Mike!

              That code allows you to add a bitmap to the left of any control, which I've been able to do. What I need to do is add a bitmap BUTTON beside the control. Since the button is a control in itself, I can't figure out how to allow them to occupy the same line.


                • Property Manager Page
                  Lee Priest
                  Okay, I have another idea.

                  What I'm trying to do is provide a calendar in my property manager page (using .NET). I've tried the following code, but I can't get it to appear (I don't get any runtime errors, just simply doesn't work).

                  Any thoughts?


                  'CONTROL Text box ------------------------------------------------------------------
                  Id = ID_CALENDAR1
                  controlType = swPropertyManagerPageControlType_e.swControlType_ActiveX
                  caption = ""
                  alignment = swPropertyManagerPageControlLeftAlign_e.swControlAlign_Indent
                  options = swAddControlOptions_e.swControlOptions_Visible + swAddControlOptions_e.swControlOptions_Enabled
                  tip = "Select the date of the revision"
                  swControl = m_group9.AddControl(Id, controlType, caption, alignment, options, tip)
                  If Not swControl Is Nothing Then
                  m_Calendar1 = swControl
                  m_Calendar1.SetClass("System.Windows.Forms.DateTimePicker", "")
                  End If
                    • Property Manager Page
                      Lee Priest
                      I believe I figured it out.

                      I had to add MSCOMCT2.OCX to the VS project references.

                      Then to my property manager class, I added: Imports MSComCtl2

                      Finally, the SetClass statement is: m_Calendar1.SetClass("MSComCtl2.DTPicker", "")

                      Not really the answer to my original question, but this may be a useful feature for others.