Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

String with underline

Posted on 1999-01-20
5
Medium Priority
?
266 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 100 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops 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.

722 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