Solved

String with underline

Posted on 1999-01-20
5
264 Views
Last Modified: 2010-04-15
How do i compose a string ( sprintf ) with underlined text ?
0
Comment
Question by:AndersCarlsson
[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
5 Comments
 
LVL 10

Accepted Solution

by:
rbr earned 50 total points
ID: 1258196
This is impossible in plain C. Underlinded text is a special font or character attribute. For which OS do you need this.
0
 

Author Comment

by:AndersCarlsson
ID: 1258197
I need this for a program in a NT system.
0
 
LVL 84

Expert Comment

by:ozo
ID: 1258198
<u>and for what kind of display device?</u>
0
 

Author Comment

by:AndersCarlsson
ID: 1258199
I want it for a string in a MessageBox, in a Windows applikation.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1258200
Message boxes cannot display underlined text.

Create a custom dialog with a static text control, and in the WM_INITDIALOG handler of said dialog create an underlined font and set it as the control's font.

Something like that:

    LOGFONT font = { 0 };
    HFONT   hFont;

    font.lfUnderline = TRUE;
    font.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN;
    hFont = CreateFontIndirect(&font);
    SendDlgItemMessage(hwnd, IDC_TEXT, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

739 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