Nov 8, 2009

VB6 - Previewing BB Code...

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Programming General > BASIC / Visual Basic (.NET)

VB6 - Previewing BB Code...

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

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
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.

Comment/Reply (w/o sign-up)

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

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
Hmmm wait up a bit. Let me try and figure it out myself biggrin.gif I'll write back soon with my findings wink.gif

Comment/Reply (w/o sign-up)

souradipm
[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

Comment/Reply (w/o sign-up)

seec77
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! biggrin.gif 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.

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Vb6 Previewing Bb Code

  1. VB.NET: Howto Add And Delete Files - Just looking for useful code (11)
    I am horrible at dealing with files in VB. I was wondering if anyone could give me some general
    code for a program I'm working on. I need to be able to add to files, display them, and delete
    them. I have use code out of a book, but it never works very well. Any suggestions?...
  2. How Do I Write Code Using WinSock Under .NET ? - (4)
  3. VS.NET: Editing Designer Generated Code Problem - Old Problem - any workarounds ? (1)
    HI,     This is a very old & well-known bug in Visual Studio 2003 and I hear it's been recitifed
    in the 2005 version. But till I get my hands on it (which isn't hapenning soon enough) I still
    got to use the old VS2003. The problem is: if you mess around with the code that lies in the region
    "Windows Forms Designer Generated Code" - the form controls just VANISH when you load it up in
    designer mode. They just won't come back however hard you try - and all you're left with is
    a BLANK form. Not that it hampers with your code from running in any way - but y...



Looking for vb6, previewing, bb, code

See Also,

*SIMILAR VIDEOS*
Searching Video's for vb6, previewing, bb, code
advertisement



VB6 - Previewing BB Code...

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com