Thank Guys for giving hints. I am sorry I forgot to add the flow or sample code. I did some perspiration and research using mdsn i think i got what i want:
Imports system.io
Public Class Form1
Dim fileContents As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
fileContents = My.Computer.FileSystem.ReadAllText("C:\File1.txt")
RichTextBox1.Text = fileContents
End Sub
Private Sub Panel1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint
Dim g As Graphics = e.Graphics
Dim txtBrush As SolidBrush = New SolidBrush(Color.Black)
Dim timeNewRoman As Font = New Font("Times New Roman", 12, FontStyle.Regular)
Dim aLine As String
Dim xposition, yposition As Short
yposition = 1
Dim strReader As New StringReader(RichTextBox1.Text)
Do While strReader.Peek <> -1
aLine = strReader.ReadLine()
xposition = 1
For Each ss As String In aLine
xposition += 1
If Char.IsLetter(ss) Then
Dim penCurrent As New Pen(Color.Red)
Dim rect As New Rectangle(20 * xposition, 20 * yposition, 20, 20)
e.Graphics.DrawRectangle(penCurrent, rect)
Dim Brush As SolidBrush = New SolidBrush(Color.Aqua)
g.FillRectangle(Brush, 20 * xposition, 20 * yposition, 19, 19)
g.DrawString(ss, timeNewRoman, txtBrush, 20 * xposition, 20 * yposition)
ElseIf ss = "*" Then
Dim penCurrent As New Pen(Color.Blue)
Dim rect As New Rectangle(20 * xposition, 20 * yposition, 20, 20)
e.Graphics.DrawRectangle(penCurrent, rect)
Dim Brush As SolidBrush = New SolidBrush(Color.Yellow)
g.FillRectangle(Brush, 20 * xposition, 20 * yposition, 19, 19)
End If
Next
yposition += 1
Loop
End Sub
End Class
>>>>Thanks guys.. Hope to answer me in next questions..I am new to using GDI. I am more on database and asp.net