Bold parameter C # [closed]

2

I have the following string:

string frase = string.Format("A data de hoje é: {0}", DateTime.Now.Date);

Is there any way to make the parameter bold?

    
asked by anonymous 30.08.2017 / 14:57

2 answers

5

Edit:

pass the value to your variable:

string frase = $"A data de hoje é: <b>{DateTime.Now.Date}</b>";

At the location where your XRLabels gets the variable frase , replace the XRLabels with a XRRichText .

XRLabels is intended to display plain text only.

XRRichText is designed specifically to display formatted text in your reports.

References: here and here

    
30.08.2017 / 15:16
3

Formatting is just for organizing the text, styles depend on the output you are using.

If it's console is one thing, if it's file is another and depends on the format that it needs, if it's printer depends on it and the technology used to generate the impression, if it's web have to use HTML or do as the generator that If you are using GUI, if it is GUI you have to see how it does this in the technology used, it varies if it is Windows Forms, WPF, UWP, GTK, Xamarin iOS, Android etc.

This code can be used like this:

var frase = $"A data de hoje é: {DateTime.Now.Date}";

With the information of the technology used we can use it in XRRichText :

seuLabel.Text = $"A data de hoje é: <b>{DateTime.Now.Date}</b>";

But if you want to use the label that is lighter (though all DevXpress components are not light), you can do:

seuLabel.Font = new Font("nome da fonte", 11, FontStyle.Bold);

But you can not do a part of the text on the same * label, you can do it in more than one side by side.

Documentation:

30.08.2017 / 15:02