Draws a diagonal line from (10,10) to (40,50) : Line « Windows Presentation Foundation « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Windows Presentation Foundation » LineScreenshots 
Draws a diagonal line from (10,10) to (40,50)
Draws a diagonal line from (10,10) to (40,50)
     
<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Fun with Graphics!" Height="345" Width="452">

  <Canvas>
    <Line Name="myLine" MouseDown ="myLine_Clicked" Cursor ="Hand"
      X1="10" Y1="10" X2="40" Y2="90"
      Stroke="Black" StrokeThickness="15" 
      StrokeEndLineCap ="Round" StrokeStartLineCap ="Triangle"/>

  </Canvas>

  <x:Code> 
  public void myLine_Clicked(Object sender, MouseButtonEventArgs e)
  {
    MessageBox.Show("You clicked the line!");
  }
  </x:Code>
</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.Set Line Along Canvas Top and LeftSet Line Along Canvas Top and Left
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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.