Solved

This is a blue moon

Posted on 2014-10-01
2
146 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
[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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
  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.

636 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