RTS Game VB.net
Hello Friends ! Today i will teach you :
How To make Real Time Strategy Game
Read more
How To make Real Time Strategy Game
THE ONLY PLACE WHERE YOU WILL GET WHAT YOU WANT
Inherits RichTextBox
Public Sub Replace(ByVal FindText As String, ByVal ReplaceText As String)
Me.Find(FindText)
If Not Me.SelectionLength = 0 Then
Me.SelectedText = ReplaceText
Else
' MsgBox("The following specified text was not found: " & FindText)
End If
End Sub
Public Sub Replace(ByVal FindText As String, ByVal ReplaceText As String, ByVal ReplaceAll As Boolean, _
ByVal MatchCase As Boolean, ByVal WholeWord As Boolean)
Select Case ReplaceAll
Case False
If MatchCase = True Then
If WholeWord = True Then
Me.Find(FindText, RichTextBoxFinds.MatchCase Or RichTextBoxFinds.WholeWord)
Else
Me.Find(FindText, RichTextBoxFinds.MatchCase)
End If
Else
If WholeWord = True Then
Me.Find(FindText, RichTextBoxFinds.WholeWord)
Else
Me.Find(FindText)
End If
End If
If Not Me.SelectionLength = 0 Then
Me.SelectedText = ReplaceText
Else
' MsgBox("The following specified text was not found: " & FindText)
End If
Case True
Dim i As Integer
For i = 0 To Me.TextLength
If MatchCase = True Then
If WholeWord = True Then
Me.Find(FindText, RichTextBoxFinds.MatchCase Or RichTextBoxFinds.WholeWord)
Else
Me.Find(FindText, RichTextBoxFinds.MatchCase)
End If
Else
If WholeWord = True Then
Me.Find(FindText, RichTextBoxFinds.WholeWord)
Else
Me.Find(FindText)
End If
End If
If Not Me.SelectionLength = 0 Then
Me.SelectedText = ReplaceText
Else
' MsgBox(i & " occurrence(s) replaced")
Exit For
End If
Next i
End Select
End Sub