wpf - StackPanel draws artifacts between each child control -
I am trying to attract a rectangle with a semi-circle at any end. I am also trying to split the rectangle where the left half is a different color for the right half, I have managed it using stack panels and combined gimetry, as shown in the example below, however, given below The code draws a line between each control within the stack panel. I have tried many things to remove it or to pull it. Does anyone know how to remove this line, which I suspect is the limit or better way? I have tried to control and not control the controls within borders, but it did not make any difference. Thanks
& lt; UserControl x: class = "xxx" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http: /sschemas.microsoft.com/winfx/2006/xaml" & Gt; & Lt; StackPanel Orientation = "horizontal" datacentext = "{binding element name = infocontrol, path =.}" & Gt; & Lt; Border background = "white" border area = "0" & gt; & Lt; Fill path = "light blue" & gt; & Lt; Path.Data & gt; & Lt; Combined Gemetry Geometry CombineMode = "pseudo" & gt; & Lt; CombinedGeometry.Geometry1 & gt; & Lt; EllipseGeometry Center = "15,15" RadiusX = "15" RadiusY = "15" /> & Lt; /CombinedGeometry.Geometry1> & Lt; CombinedGeometry.Geometry2 & gt; & Lt; RectangleGeometry Rect = "0 15 15 30" /> & Lt; /CombinedGeometry.Geometry2> & Lt; / CombinedGeometry & gt; & Lt; /Path.Data> & Lt; / Path & gt; & Lt; / Border & gt; & Lt; Border background = "lightblue" borderline = "0" & gt; & Lt; TextBlock x: name = "nameTextBlock" foreground = "steelblue" vertical alignment = "center" fontism = "16" margin = "0 0 5 0" & gt; - & lt; / TextBlock & gt; & Lt; / Border & gt; & Lt; Border background = "cornflowerblue" borderline = "0" & gt; & Lt; TextBlock x: name = "datattextblock" foreground = "white" vertical alignment = "center" font system = "16" margin = "5 0 0 0" & gt; - & lt; / TextBlock & gt; & Lt; / Border & gt; & Lt; Border background = "white" border area = "0" & gt; & Lt; Fill path = "cornflowerblue" & gt; & Lt; Path.Data & gt; & Lt; Combined Gemetry Geometry CombineMode = "pseudo" & gt; & Lt; CombinedGeometry.Geometry1 & gt; & Lt; EllipseGeometry Center = "0,15" RadiusX = "15" RadiusY = "15" /> & Lt; /CombinedGeometry.Geometry1> & Lt; CombinedGeometry.Geometry2 & gt; & Lt; RectangleGeometry Rect = "0 30 30" /> & Lt; /CombinedGeometry.Geometry2> & Lt; / CombinedGeometry & gt; & Lt; /Path.Data> & Lt; / Path & gt; & Lt; / Border & gt; & Lt; / StackPanel & gt;
Set SnapsToDevicePixel
S true
to your stackpanel
:
Read for clarification.
Comments
Post a Comment