Compartir a través de


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);
}
/** @property */
public PenTip get_PenTip ()

/** @property */
public void set_PenTip (PenTip value)
public function get PenTip () : PenTip

public function set PenTip (value : PenTip)
Not applicable.

Property Value

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.

Example

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 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

DrawingAttributes Class
DrawingAttributes Members
Microsoft.Ink Namespace
DrawingAttributes.Height
DrawingAttributes.Width