Jump to content
RJ90

Diferentes Fontes na mesma TextBlock

Recommended Posts

RJ90

Boas,

A minha duvida é a seguinte, estou a tentar meter duas fontes diferentes na mesma TextBlock.

Passo a explicar melhor:

<Button Height="74" HorizontalAlignment="Center" Margin="0,490,0,0" Name="btnLogin" VerticalAlignment="Top" Width="236" Click="btnLogin_Click">
<Button.Content>
	<TextBlock FontSize="42" Foreground="#FF009DDC" FontFamily="">login</TextBlock>
        </Button.Content>
</Button>

Em que no FontFamily temos Cronos Pro Display e Cronos Pro Bold Display. E no texto que se apresenta (login), o log é com a fonte Cronos Pro Display e o in é com Cronos Pro Bold Display.

Como faço?

Obrigado!


Samsung 700Z5A-S01PT Samsung Ominia W

ᥡ What Else? ᥡ

Share this post


Link to post
Share on other sites
RJ90

Obrigado saramgsilva!

Aqui fica o código:

<Button Height="74" HorizontalAlignment="Center" Margin="0,490,0,0" Name="btnLogin" VerticalAlignment="Top" Width="236" Click="btnLogin_Click">
<Button.Content>
	<StackPanel Orientation="Horizontal">
		<TextBlock FontSize="44" Foreground="#FF009DDC" FontFamily="Cronos Pro Display">log</TextBlock>
                    	<TextBlock FontSize="46" Foreground="#FF009DDC" FontFamily="Cronos Pro Bold Display">in</TextBlock>
                </StackPanel>                
</Button.Content>
</Button>


Samsung 700Z5A-S01PT Samsung Ominia W

ᥡ What Else? ᥡ

Share this post


Link to post
Share on other sites
koxta

boas

e como posso criar um textblock com 2 run's por exemplo no código??

por exemplo Texblock t=new Textblock(); etc etc

cumprimentos

Share this post


Link to post
Share on other sites
koxta

hum ok... e como "formato" os items individualmente?isto é, tenho:

string s1 = "teste1";

string s2 = "testeAUX";

textBlock1.Inlines.Add(s1 + s2);

como poderia dar tamanhos/cores diferentes a s1 e a s2?

Cumprimentos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.