forum

Home / DeveloperSection / Forums / To scroll a text inside picture box

To scroll a text inside picture box

Madhu Mitha 1839 22-Mar-2015
hi thr,

          I want to scroll text inside a picturebox, from right to left can anyone help me in solving this problem..

My code is 

Public Class Form1
    Dim brush As New Drawing.SolidBrush(Color.Black)
    Dim g2 As System.Drawing.Graphics
    Dim img As New Bitmap(400, 100)
    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        g2 = Graphics.FromImage(img)
        PictureBox1.Image = img
        g2.Clear(Color.White)
        g2.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
        g2.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
        g2.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
        '
        g2.DrawString(TextBox1.Text, TextBox1.Font, Brushes.Red, 0, 0)
    End Sub
End Class


Updated on 22-Mar-2015

Can you answer this question?


Answer

1 Answers

Liked By