Syntax Highligthing error
Hej Eksperter q:Jeg har et problem med et stykke vb kode, det skulle være en syntax highlighting men jeg får denne fejl:
Type 'DataRow' is not defined
I dette stykke kode:
Public Sub ColorLineNumber(ByVal LineIndex As Integer, ByVal lStart As Integer)
Dim i As Integer = 0
Dim Instance As Integer
Dim LeadingChar, TrailingChar As String
Dim SelectionAt As Integer = Me.SelectionStart
Dim MyRow As DataRow
Dim Line() As String, MyI As Integer, MyStr As String
' Lock the update
LockWindowUpdate(Me.Handle.ToInt32)
MyI = lStart
If CaseSensitive Then
Line = Split(Me.Lines(LineIndex).ToString, " ")
Else
Line = Split(Me.Lines(LineIndex).ToLower, " ")
End If
For Each MyStr In Line
Me.SelectionStart = MyI
Me.SelectionLength = MyStr.Length
If Words.Rows.Contains(MyStr) Then
MyRow = Words.Rows.Find(MyStr)
If (Not CaseSensitive) Or (CaseSensitive And MyRow("Word") = MyStr) Then
Me.SelectionColor = Color.FromName(MyRow("Color"))
End If
Else
Me.SelectionColor = Color.Black
End If
MyI += MyStr.Length + 1
Next
' Restore the selectionstart
Me.SelectionStart = SelectionAt
Me.SelectionLength = 0
Me.SelectionColor = Color.Black
' Unlock the update
LockWindowUpdate(0)
End Sub
Nogen der kan hjælpe?
Bruger Visual Basic 2008 Express Edition..
-Oliver
