Solved

This is a blue moon

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

932 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

8 Experts available now in Live!

Get 1:1 Help Now