perry wrote:Do I need to add more columns to the tablelayout? This positioning control thing from plugin is driving me crazy...
Yep, in the plugin in you should be setting the controls Col and Row properties.
When I look at the Inventory Maintenance form, SOH - Transaction Detail in the Visual Studio designer - it looks like this:
Note the control with the focus is the TableLayoutPanel5 control - that is the control the FreeNumericEditor control sits in. The positioning of the control is not done by setting the location and size - but by setting the Col and Row extender properties introduced when the control was placed. To give an idea, here's the designer code relating to the FreeNumericEditor:
- Code: Select all
Me.TableLayoutPanel5.Controls.Add(Me.FreeNumericEditor, 3, 0) ' <--- Note the 3,0 is the Col,Row parameters.
'
'FreeNumericEditor
'
Me.FreeNumericEditor.DecimalPlaces = 2
Me.FreeNumericEditor.Dock = System.Windows.Forms.DockStyle.Fill
Me.FreeNumericEditor.Location = New System.Drawing.Point(303, 3)
Me.FreeNumericEditor.MaskClipMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw
Me.FreeNumericEditor.MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals
Me.FreeNumericEditor.MaskInput = "-nnn,nnn,nnn,nnn,nnn.nn"
Me.FreeNumericEditor.MaxValue = 9999999999999.99R
Me.FreeNumericEditor.Name = "FreeNumericEditor"
Me.FreeNumericEditor.Nullable = True
Me.FreeNumericEditor.NumericType = Infragistics.Win.UltraWinEditors.NumericType.[Decimal]
Me.FreeNumericEditor.PromptChar = Global.Microsoft.VisualBasic.ChrW(32)
Me.FreeNumericEditor.Size = New System.Drawing.Size(94, 21)
Me.FreeNumericEditor.TabIndex = 18
Me.FreeNumericEditor.TabNavigation = Infragistics.Win.UltraWinMaskedEdit.MaskedEditTabNavigation.NextControl
Me.FreeNumericEditor.ThousandsSeparator = True
Me.FreeNumericEditor.ThousandsSeparatorChar = Global.Microsoft.VisualBasic.ChrW(44)
If you want to add more controls within that TableLayoutPanel control, you will need to add some columns to it first. I think the reason it worked with your first control is because there is one spare cell to the right of the cell the FreeNumericEditor resides in - i.e.: it set the Col and Row for you automatically to the first free spot. To assist you, here is the designer code for that layout panel:
- Code: Select all
'
'TableLayoutPanel5
'
Me.TableLayoutPanel5.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.TableLayoutPanel5.ColumnCount = 7
Me.TableLayoutPanel5.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 130.0!))
Me.TableLayoutPanel5.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 63.0!))
Me.TableLayoutPanel5.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 107.0!))
Me.TableLayoutPanel5.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100.0!))
Me.TableLayoutPanel5.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TableLayoutPanel5.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 129.0!))
Me.TableLayoutPanel5.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 281.0!))
Me.TableLayoutPanel5.Controls.Add(Me.FreeNumericEditor, 3, 0)
Me.TableLayoutPanel5.Controls.Add(Me.SOHNumericEditor, 2, 0)
Me.TableLayoutPanel5.Controls.Add(Me.SOHFreeLabel, 1, 0)
Me.TableLayoutPanel5.Controls.Add(Me.SOHShowZeroValuesCheckBox, 0, 0)
Me.TableLayoutPanel5.Controls.Add(Me.SOHSpecificWarehouseCheckBox, 5, 0)
Me.TableLayoutPanel5.Controls.Add(Me.SOHSpecificWarehouseLookup, 6, 0)
Me.TableLayoutPanel5.Location = New System.Drawing.Point(3, 276)
Me.TableLayoutPanel5.Name = "TableLayoutPanel5"
Me.TableLayoutPanel5.RowCount = 1
Me.TableLayoutPanel5.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 26.0!))
Me.TableLayoutPanel5.Size = New System.Drawing.Size(943, 24)
Me.InboxControlStyler1.SetStyleSettings(Me.TableLayoutPanel5, New Infragistics.Win.AppStyling.Runtime.InboxControlStyleSettings(Infragistics.Win.DefaultableBoolean.[Default]))
Mike