Jump to content
xisto Community
WeaponX

VB6 - Previewing BB Code...

Recommended Posts

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 "" 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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
and
 are difficult to do, but [url]
http://forums.xisto.com/
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

Edited by souradipm (see edit history)

Share this post


Link to post
Share on other sites

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! :unsure: I can't remember right now how to use the IE control, but generally you've got to look around the control list for "Microsoft Internet Explorer" or something. And as for regexes, that site also has a very good tutorial on them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.