|
|
|
|
![]() ![]() |
Jul 14 2006, 09:58 PM
Post
#1
|
|
|
Way Out Of Control - You need a life :) Group: Members Posts: 1,086 Joined: 21-June 05 From: New York Member No.: 6,440 |
I'm using Visual Basic 6 and want to know how (if possible) to create a program to preview BB code. Like the codes here using InvisionBoard with the "[b]" tag for bold as an example. I want my program to allow the user to enter BB code and convert them to formatted text. Is this possible?
Thanks. |
|
|
|
Jul 15 2006, 11:00 AM
Post
#2
|
|
|
PsYcheDeLiC dR3aMeR Group: Admin Posts: 2,242 Joined: 29-January 05 From: Nakorn Chaisri, Thailand Member No.: 2,411 |
It shouldn't be difficult at all.
What you're to do is use a RichTextBox - and then analyze the string and replace the formatting accordingly. But keep in mind - it's quite difficult to emulate all the BBCodes in a RTF box. The standard ones like Bold, Italics etc are easy - but where it comes to stuff like QUOTE etc. it's a difficult process. Can be done but really tricky. |
|
|
|
Jul 15 2006, 09:48 PM
Post
#3
|
|
|
Way Out Of Control - You need a life :) Group: Members Posts: 1,086 Joined: 21-June 05 From: New York Member No.: 6,440 |
Hi m^e, that's exactly what I thought I had to do also. I actually started doing this but then was stuck on some of them.
1. How would I deal with "[url=" tags? I need it to find out how to take away that right bracket ']' from the '[url' tags and any other tags that require a link inside. 2. How do I make it so each new line only counts as a single line break? I'm using a richtextbox now and every enter (new line) I hit, will create a double new line in the HTML window. I tried everything that I can think of (using DIV or no HTML at all, but just hitting Enter). Still skips two lines down. |
|
|
|
Jul 17 2006, 04:36 PM
Post
#4
|
|
|
PsYcheDeLiC dR3aMeR Group: Admin Posts: 2,242 Joined: 29-January 05 From: Nakorn Chaisri, Thailand Member No.: 2,411 |
Hmmm wait up a bit. Let me try and figure it out myself
|
|
|
|
Jul 17 2006, 07:03 PM
Post
#5
|
|
|
Member [ Level 1 ] Group: Members Posts: 42 Joined: 17-July 06 Member No.: 14,552 |
[QUOTE] and [code] are difficult to do, but [url] tags you just colour it blue and add underlining. It would be easy to start doing it and get almost finished.
What you could do with the quote and code is make graphic stuff for them and and a RichTextBox in between when the user clicks 'Preview', if you know what I mean and format it in a font and colour. So I think it might be easy for an intermediate person. You could add a WebBrowser object in VB8 and make it go to a prewiew script in PHP on a web server, which I think is the simplest way to do it. Cheers, souradipm This post has been edited by souradipm: Jul 17 2006, 07:05 PM |
|
|
|
Jul 18 2006, 12:09 AM
Post
#6
|
|
|
Advanced Member Group: Members Posts: 157 Joined: 16-May 06 Member No.: 13,476 |
Actually, I think you're better of using the IE ActiveX control, and generating some simple HTML. Oh, and while I'm at it, I might as well recommend regular expressions for this daunting task!
|
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 14th October 2008 - 04:46 AM |