Trying to create custom grid true FlowLayoutPanel but there is distance imperfection. How to fix them?

0
0

Trying to create custom grid true FlowLayoutPanel but there is distance imperfection. How to fix them?

Please find image attached

Source code:

Dim OPanelContent As New Wisej.Web.FlowLayoutPanel

Public Sub New()
Dim OTB As Wisej.Web.TextBox = Nothing

With OPanelContent
.Dock = Wisej.Web.DockStyle.Left
.Width = 377
.BackColor = System.Drawing.Color.DarkBlue
End With

For i = 1 To 60
OTB = New Wisej.Web.TextBox
With OTB
.BorderStyle = Wisej.Web.BorderStyle.None
.Height = 21
.Width = 77
.Margin = New Wisej.Web.Padding(0, 0, 1, 1)
End With
OPanelContent.Controls.Add(OTB)
Next

With Me
.Dock = Wisej.Web.DockStyle.Fill
.Controls.Add(OPanelContent)
End With
End Sub

 

Attachment
  • You must to post comments
0
0

There is no extra space. What you see is the result of subpixel rounding done by the browser. Check your window.devicePixelRatio. You can reproduce the same “effect” just with plain html and css: https://jsfiddle.net/je4pfoky/15/ And you can also find hundreds of posts related to this issue.

There is no solution to this problem in any environment. All you can do is use value multiples that may avoid rounding depending on the pixel ratio, which changes depending on the user’s device and the browser’s zoom value.

  • mgmst
    • mgmst
    • Jul 29, 2018 - 7:25 am
    Thank you for your answer. Is there another way to build my grid. As i can see your grids are build without distance imperfections.
  • Luca (ITG)
    Don’t use margins. A margin of 0px cannot be messed up by the browser.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.