Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do you make an html editor like this?

Posted on 2006-07-05
3
Medium Priority
?
296 Views
Last Modified: 2013-12-16
Is there any way to have a richtextbox that when you type "<html>" it colors that text only and not the rest of the text?
Please help,
Joseph
0
Comment
Question by:JoeTheCoinMan
[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
3 Comments
 
LVL 15

Expert Comment

by:lakshman_ce
ID: 17046462
Find for the tag and color it before loading to your form

Sample code

RichTextBox* richTextBox1 = new RichTextBox();
richTextBox1->Dock = DockStyle::Fill;
richTextBox1->LoadFile(S"C:\\IssuesSystem.rtf",RichTextBoxStreamType::RichText);
richTextBox1->Find(S"<html>", RichTextBoxFinds::MatchCase);
richTextBox1->SelectionColor = Color::Red;
this->Controls->Add(richTextBox1);
0
 

Author Comment

by:JoeTheCoinMan
ID: 17046510
So there is no way to do this as the user types?
0
 
LVL 15

Accepted Solution

by:
lakshman_ce earned 2000 total points
ID: 17047882
There is a way but it would be after the completion of <html> tag

1. Handle the RichTextBox_TextChanged event
2. Get the text in the richtextbox
3. Find the string <html> in it
4. change the color

void richTextBox1_TextChanged(Object* /*sender*/, EventArgs* /*e*/) {
{
richTextBox1->Find(S"<html>", RichTextBoxFinds::MatchCase);
richTextBox1->SelectionColor = Color::Red;
}


0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

597 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