Condividi tramite


DrawingAttributes.PenTip Property

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.

Definition

Visual Basic .NET Public Property PenTip As PenTip
C# public PenTip PenTip { get; set; }
Managed C++ public: __property PenTip* get_PenTip();
public: __property void set_PenTip(PenTip*);

Property Value

Microsoft.Ink.PenTip. Which pen tip to use when drawing ink that is associated with this DrawingAttributes object.

This property is read/write. This property has no default value.

Ball0 Specifies a round pen tip.
Rectangle1 Specifies 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

[C#]

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();
    }
                

[VB.NET]

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
                

See Also