DrawingAttributes.PenTip Property
Gets or sets a value that indicates which pen tip to use when drawing ink that is associated with this DrawingAttributes object.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public Property PenTip As PenTip
'Usage
Dim instance As DrawingAttributes
Dim value As PenTip
value = instance.PenTip
instance.PenTip = value
public PenTip PenTip { get; set; }
public:
property PenTip PenTip {
PenTip get ();
void set (PenTip value);
}
public function get PenTip () : PenTip
public function set PenTip (value : PenTip)
Property Value
Type: Microsoft.Ink.PenTip
Which pen tip to use when drawing ink that is associated with this DrawingAttributes object.
Value |
Meaning |
---|---|
Ball |
The pen renders as a round pen tip. |
Rectangle |
The pen renders as a rectangular pen tip. |
Remarks
For a complete list of pen tips available to use, see the PenTip enumeration.
To create a square pen tip, set the PenTip property to Rectangle. Then set the Width property equal to the Height property.
Examples
This C# example creates event handlers for menu items that change the PenTip property of a DrawingAttributes object.
using Microsoft.Ink;
using Microsoft.Ink;
//...
private System.Windows.Forms.MenuItem menuInkPenTipBall;
private System.Windows.Forms.MenuItem menuInkPenTipRectangle;
private InkCollector theInkCollector;
private System.Windows.Forms.MenuItem checkedPenTip;
//...
private void menuInkPenTipBall_Click(
object sender, System.EventArgs e)
{
checkedPenTip.Checked = false;
theInkCollector.DefaultDrawingAttributes.PenTip = Microsoft.Ink.PenTip.Ball;
checkedPenTip = menuInkPenTipBall;
checkedPenTip.Checked = true;
Refresh();
}
private void menuInkPenTipRectangle_Click(
object sender, System.EventArgs e)
{
checkedPenTip.Checked = false;
theInkCollector.DefaultDrawingAttributes.PenTip = Microsoft.Ink.PenTip.Rectangle;
checkedPenTip = menuInkPenTipRectangle;
checkedPenTip.Checked = true;
Refresh();
}
This Microsoft® Visual Basic® .NET example creates event handlers for menu items that change the PenTip property of a DrawingAttributes object.
Imports Microsoft.Ink
'...
Dim MenuInkPenTipBall As System.Windows.Forms.MenuItem
Dim MenuInkPenTipRectangle As System.Windows.Forms.MenuItem
Dim CheckedPenTip As System.Windows.Forms.MenuItem
Dim theInkCollector As InkCollector
'...
Private Sub MenuInkPenTipBall_Click( _
ByVal sender As Object, ByVal e As System.EventArgs)
CheckedPenTip.Checked = False
theInkCollector.DefaultDrawingAttributes.PenTip = Microsoft.Ink.PenTip.Ball
CheckedPenTip = MenuInkPenTipBall
CheckedPenTip.Checked = True
Refresh()
End Sub
Private Sub MenuInkPenTipRectangle_Click( _
ByVal sender As Object, ByVal e As System.EventArgs)
CheckedPenTip.Checked = False
theInkCollector.DefaultDrawingAttributes.PenTip = Microsoft.Ink.PenTip.Rectangle
CheckedPenTip = MenuInkPenTipRectangle
CheckedPenTip.Checked = True
Refresh()
End Sub
Platforms
Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0