Solved

This is a blue moon

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

837 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