Results 1 to 5 of 5

Thread: Add drop shadow to text?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Add drop shadow to text?

    Hello,

    Is there a way to add drop shadow to text in VB.NET?

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    i should probably write a aritcle on this..
    here is the code


    Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
    Dim g As Graphics = e.Graphics
    g.DrawString("Kovan", New Font("Arial", 40), New SolidBrush(Color.Gray), 55, 55) 'SHADOW
    g.DrawString("Kovan", New Font("Arial", 40), New SolidBrush(Color.Black), 50, 50) 'ORIGINAL TEXT
    End Sub

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Thanks

    How would I call this using a button click event?

  4. #4
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    2 ways.

    1. put a boolean check in the paint which you set from the button
    2. use a picture box instead of the actual form, and use method 1 with it.

    .DrawString() requires PaintEventArgs e,:

    so you can use anything that has PaintEventArgs

  5. #5
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    You may like to take a look at this site too.
    http://www.bobpowell.net/dropshadowtext.htm
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width