|
-
Mar 19th, 2010, 06:26 AM
#1
[RESOLVED] Parsing and coloring the VB CODES in my Richtextbox [SUGGESTIONS & HELP NEEDED]
Hi all...
I am trying to create a small vb6 code viewer.Which will simply display the VB6 codes in color coded form. See below for an example:
vb Code:
Option Explicit
Private Sub Command1_Click() '~~~ Search button
Dim i As Long
List2.Clear '~~~> Empty everything
For i = 0 To List1.ListCount - 1 '~~~> Loop through the list in 1st Listbox
If InStr(1, List1.List(i), Trim$(Text1.Text), vbTextCompare) <> 0 Then '~~> Checking for the entry
List2.AddItem List1.List(i) '~~~> If found, add it to the 2nd Listbox
End If
Next i
End Sub
Private Sub Form_Load()
'~~~ Load the listbox with sample data
List1.AddItem "D:\MUSIC\Music Collection Updated\Akon ft nas - locked up rmx.mp3"
List1.AddItem "D:\MUSIC\Music Collection Updated\Ciara - Oh.mp3"
List1.AddItem "C:\MUSIC\Music Collection Updated\Fabolous - Can U hear me.mp3"
List1.AddItem "C:\MUSIC\Music Collection Updated\Fabolous - Cant_let_you_go.mp3"
End Sub
Here, the reserved words are set with the blue color, comments with green, constants(numbers) with pink and text with brown.
How can I implement the same coloring methods in my own VB6 code viewer..????
Any ideas...???
Thanks.... 
Edit:
I know the basic methods for finding and changing words by using Find method of RichTextBox and some basic manipulations using InStr(), Mid(), Replace(), etc...
But I was looking for something that is more efficient and speedy, because the code might be of large lines....
For displaying the VBCode, I will be using a RichtTextbox...
Thanks...
Last edited by akhileshbc; Mar 19th, 2010 at 06:49 AM.
Reason: added more information
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|