Set Line Along Canvas Top and Left : Line « Windows Presentation Foundation « VB.Net






Set Line Along Canvas Top and Left

Set Line Along Canvas Top and Left
     

<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WPF" Height="250" Width="500">
    <StackPanel Orientation="Horizontal">
        <Canvas Margin="5">
            <TextBlock FontSize="14" Text="Lines in a Canvas:"/>
            <Line Canvas.Top="100" Canvas.Left="20"  X2="200" Y2="40" Stroke="Black" StrokeThickness="5"/>
            <Line Canvas.Bottom="30" Canvas.Left="180" X1="0" Y1="30" X2="-10" Y2="-130" Stroke="Black" StrokeThickness="5"/>            
        </Canvas>
    </StackPanel>
</Window>

   
    
    
    
    
  








Related examples in the same category

1.Line position and color and thicknessLine position and color and thickness
2.Draw a LineDraw a Line
3.Add Line to StackPanelAdd Line to StackPanel
4.Set line Stroke and StrokeThicknessSet line Stroke and StrokeThickness
5.Add Line and TextBlock to CanvasAdd Line and TextBlock to Canvas
6.Draws a diagonal line from (10,10) to (40,50)Draws a diagonal line from (10,10) to (40,50)
7.Two Lines in a StackPanelTwo Lines in a StackPanel
8.Create a simple line using the LineSegment and PathGeometryCreate a simple line using the LineSegment and PathGeometry
9.Creates a blue line from point (30, 30) to point (180, 30):Creates a blue line from point (30, 30) to point (180, 30):
10.Creating LinesCreating Lines