Solved

This is a blue moon

Posted on 2014-10-01
2
125 Views
Last Modified: 2014-10-01
This is a blue moon.

AnsiString as = "This is a ";
Form1->Memo1->Lines->Add(as);
// OK so far...

I am puzzled as to how I might underline one word in a line of text being added or inserted into an ansistring within a Memo object.

Using
Form1->Memo1->Font->Style = TFontStyles() << fsUnderline;
has the unfortunate effect of rewriting the whole of the existing text in the memo object in the underlined style. To reiterate- I want just one word underlined.

Is there a way to exert more precise control over what gets written to the memo object?
0
Comment
Question by:VaughanMx
2 Comments
 
LVL 16

Accepted Solution

by:
George Tokas earned 500 total points
ID: 40354206
Not with the TMemo component.
The lines you add are AnsiStrings and TMemo keeping them as an array (TStrings).
If you want that kind of control use TRichEdit component from Win32 tab.

George Tokas.
0
 

Author Closing Comment

by:VaughanMx
ID: 40354479
Thanks - exactly what I was looking for.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now