Solved

This is a blue moon

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

762 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