how to select the pen color using the color dialog box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yaacovsadeh
    New Member
    • Dec 2011
    • 1

    #1

    how to select the pen color using the color dialog box

    How can I select the color of my pen using the color dialog box?
    I tried:
    If ColorDialog1.Sh owDialog() = Windows.Forms.D ialogResult.OK
    Then
    Dim MyPen As New Pen(Color.Color Dialog1.Color, 1)
    end if
    but I get error:colordial og1 is not member of system.drawing. color
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    ColorDialog1 is an object, not a part of the Color library:

    Dim MyPen As New Pen(ColorDialog 1.Color, 1)

    will do

    Comment

    Working...