How to include special Char in Static text lable?

779 views Asked by At

In Static text Label, I want to include a special char,which is having ASCII value 167.I am having a Static text ID.How Can I display the Special Char in that Static Text label using that Id in a Dialog Window?

Thanks in Advance....

2

There are 2 answers

0
snowdude On BEST ANSWER

Assuming you're using Visual Studio you should be able to just copy it into the Properties window for the label. Use the Character Map application to find the character you want (which on my machines is §), Select it, then Copy it, and then just paste it into the 'Caption' property for the Static text.

1
Himanshu On

This is very simple work to do

CString abc;    //Take CString variable
abc = _T("Hello §");  // Give Value

m_label.SetWindowText(abc);  // Create variable of static label, set its text

Or

GetDlgItem(IDC_YOUR_LABEL_ID)->SetWindowText(abc);

If you don't know How to how to print ASCII value?. Its very Simple for example here you have to print value 0167.
Just press Alt + 0167 and you will get §. You can try it in Visual studio or even in notepad also. It will work fine.