Solved

String with underline

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Suggested Solutions

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…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
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 switch statements in the C programming language.

911 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

16 Experts available now in Live!

Get 1:1 Help Now