Solved

Front Page Type Look

Posted on 1998-11-10
4
147 Views
Last Modified: 2010-04-30
Dear Experts,
   Can someone please explain to me, how to get the effect displayed in Microsoft Front Page 97+ under the html view?  I want to use a richtextbox and i would like to have my program automaticly change the color of the different html tags without lagging the user.  Please respond.
-CompGuy-
0
Comment
Question by:CompGuy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 1444193
You need to scan in the HTML as you place it into the RTB. When you see a marker in the HTML that you want to take action on, change the .SelColor property before appending the text.

I'd set up a table with tags and colors or use a SELECT CASE to make your color choice decisions.

Write if you need code for color change and/or text append.

M

0
 

Author Comment

by:CompGuy
ID: 1444194
Thanks for the reply.  First off, it sounds like you have the answer, but since I have just started using RTB's, Actually doing what your saying is a little hard.  Would you mind a simple example?  I'm going to fool around with what you've said so far to see if i can't get it for myself, but if not, I would appreciate a sample.. Thanks.
-CompGuy-
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1444195
Well, the hardest part is in scanning the HTML. You have to recognise *all* tags - even the ones you *DON'T handle.

The RichTextBox has a series of Selxxxx properties, Bold, Italic, Underline, Color, etc One you set 'em all additional text passed into the control assumes that property state.

Sooooo. You have to scan the raw HTML and watch for your codes: <B>, <U>, <I>, etc. and then adjust the state of the RTB's SelBold, SelUnderline, SelItalic, etc. properties to match. You'll also have to watch for the end codes. Imagine something like:

SELECT CASE Token
    CASE "<B>"
        RTB.SelBold = True
    CASE "<U>"
        RTB.SelUnderline = True
    CASE "<I>"
        RTB.SelItalic = True
    CASE "</B>"
        RTB.SelBold = False
    CASE "</U>"
        RTB.SelUnderline = False
.
    CASE ELSE
END SELECT

etc, etc, etc,

I can give you a form that edits a RTB and saves it to disk. It tracks all of the .SEL params. It controls them from a menu, but your code code set them as shown above.

The tricky part is what to do with unhandled HTML.

M

0
 

Author Comment

by:CompGuy
ID: 1444196
Okay, i kinda see what your saying.  That for would help though.. Could you send it to CompGuy2@aol.com?  Thanks.
-CompGuy-
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question