2 Replies Latest reply on Mar 20, 2014 12:22 AM by Kieu Tran

    Anchor in PropertyManager page

    Kieu Tran

      Hi everyone,

       

      I want to fixed-left some controls on PropertyManager page when I slide FeatureManager Tree, like image bellow:

      Untitled.png

       

      For example code:

              label1 = group1.AddControl(label1ID, 1, "Label:", 1, 7, "")

              label2.Top = 0

             

              controlType = swPropertyManagerPageControlType_e.swControlType_Combobox

              leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge

              options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

              combo1 = group2.AddControl(combo1ID, controlType, "Type:", leftAlign, options, "Chose Option")

              If Not combo1 Is Nothing Then

                  Dim items() As String = New String() {"First", "Second", "Third", "Fourth"}

                  combo1.Height = 50

                  combo1.Style = swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly

                  combo1.AddItems(items)

              End If

              combo1.Left = 30

              combo1.Top = 0

       

      Thanks and regards,

      Kieu Tran.

        • Re: Anchor in PropertyManager page
          Artem Taturevych

          Use PropertyManagerPageControl::OptionsForResize and set swControlOptionsOnResize_LockLeft.

           

          In your case:

           

          combo1 = group2.AddControl(combo1ID, controlType, "Type:", leftAlign, options, "Chose Option")

          CType(combo1, PropertyManagerPageControl).OptionsForResize = swPropMgrPageControlOnResizeOptions_e.swControlOptionsOnResize_LockLeft

          ______________________________________________

          Regards, Artem Taturevych | Snr. Developer | IC3D ANZ

           

          IC3DSteel – New Steel Solution for SolidWorks

          translationXpert – SolidWorks files language translator

          LinkedIn - SolidWorks API Group

            • Re: Anchor in PropertyManager page
              Kieu Tran

              Thanks so much, Artem Taturevych! It works.

              But it still have small problem on selection box. Case 2 in the image below:

              2014-03-20 10_45_02-Untitled - Paint.png

               

              And an other problem, case 1. It was be obscured when PropertyManager page dragged. I dont know what happened.

               

              Here is my code:

               

                     label2 = group2.AddControl(label2ID, 1, "Type:", 1, 7, "")

                      label2.Top = 0

                      'Combo1

                      controlType = swPropertyManagerPageControlType_e.swControlType_Combobox

                      leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge

                      options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

                      combo1 = group2.AddControl(combo1ID, controlType, "Type:", leftAlign, options, "Chose Option")

                      If Not combo1 Is Nothing Then

                          Dim items() As String = New String() {"Compliance (Stiffness)", "Natural Frequency", "Displacement", "Strain"}

                          combo1.Height = 50

                          combo1.Style = swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly

                          combo1.AddItems(items)

                      End If

                      combo1.OptionsForResize = swPropMgrPageControlOnResizeOptions_e.swControlOptionsOnResize_LockLeft + swPropMgrPageControlOnResizeOptions_e.swControlOptionsOnResize_LockRight

                      combo1.Left = 30

                      combo1.Top = 0

               

               

                      label3 = group2.AddControl(label3ID, 1, "Study:", 1, 7, "")

                      label3.Top = 30

                      'Combo2

                      controlType = swPropertyManagerPageControlType_e.swControlType_Combobox

                      leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge

                      options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

                      combo2 = group2.AddControl(combo2ID, controlType, "Study:", leftAlign, options, "Chose Option")

                      combo2.Style = swPropMgrPageComboBoxStyle_e.swPropMgrPageComboBoxStyle_EditBoxReadOnly

                      combo2.OptionsForResize = swPropMgrPageControlOnResizeOptions_e.swControlOptionsOnResize_LockLeft + swPropMgrPageControlOnResizeOptions_e.swControlOptionsOnResize_LockRight

                      combo2.Left = 30

                      combo2.Top = 30

               

               

                      label4 = group2.AddControl(label4ID, 1, "Parts:", 1, 7, "")

                      label4.Top = 60

                      'Selection2

                      controlType = swPropertyManagerPageControlType_e.swControlType_Selectionbox

                      leftAlign = swPropertyManagerPageControlLeftAlign_e.swControlAlign_LeftEdge

                      options = swAddControlOptions_e.swControlOptions_Enabled + swAddControlOptions_e.swControlOptions_Visible

                      selection2 = group2.AddControl(selection2ID, controlType, "Select Part:", leftAlign, options, "Solid Bodies")

                      If Not selection2 Is Nothing Then

                          Dim filter() As Integer = New Integer() {swSelectType_e.swSelSOLIDBODIES}

                          selection2.AllowSelectInMultipleBoxes = True

                          selection2.Height = 30

                          selection2.SetSelectionFilters(filter)

                          selection2.SetSelectionColor(True, swUserPreferenceIntegerValue_e.swSystemColorsSelectedItem1)

                      End If

                      selection2.OptionsForResize = swPropMgrPageControlOnResizeOptions_e.swControlOptionsOnResize_LockLeft + swPropMgrPageControlOnResizeOptions_e.swControlOptionsOnResize_LockRight

                      selection2.Top = 60

                      selection2.Left = 30