textblock

Bind WPF TextBlock to text file

How can I bind a WPF TextBlock to a text file? I want for the TextBlock to display the content of the file. ...

Wpf Binding Stringformat to show only first character

Hi, Is there any way so that i can show only first character of a Bound string on a textblock..? For eg;If i Bind 'Male', my textblock should only show 'M'..... ...

WPF Formatting text in a TextBlock bound to a string

I have a custom control which has a string Description dependancy property as shown below: <CustomControl> <CustomControl.Description> Hello World </CustomControl.Description> </CustomControl> This description is bound in several places in TextBlock's as shown below: <Button> <Button.ToolTip> <TextBlock Te...

Align bottoms of text in controls

The following snippet: <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; <Grid> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"> ...

Textblock with link to text file inside

Hi everyone, I am setting different text to a textblock depending on what control has been selected as a way of providing help for the user. What I would like to do is in the code behind file, when one control is selected, provide a brief explanation in text, then provide a link to a text file within that textblock. It might look lik...

Add hyperlink to textblock wpf

Greetings, I have some text in db and it is as follows: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis tellus nisl, venenatis et pharetra ac, tempor sed sapien. Integer pellentesque blandit velit, in tempus urna semper sit amet. Duis mollis, libero ut consectetur interdum, massa tellus posuere nisi, eu aliquet elit lacus ...

How to display the text in one line in wpf textblock

Hi all: I'm a newbie with wpf , what i want to display the text in one line in wpf textblock. eg : ` Text ="asfasfasfa asdasdasd" , ` TextBlock display it in two lines default, but i want it in only one line like this"asafsf asfafaf". I mean show all the text in one line even there are more than one lines in the text wha...

WPF Setting the default style on a TextBlock overrides the style for a Label

Setting the default style on a TextBlock causes the style in the Label and other controls to be set as well. This only happens if you put the styles in the Application resources, when I place the style in the Window resources everything is fine. I have also found that the VS 2008 Designer and XamlPadX display the Label as you would expe...

Selecteditem color in textBlock in ListBox in WPF

Hi,I have textblcok in my listbox as listboxitem.When i seelct the item in that,it shows blue in color.I dont want that.How can i remve that. My XAML: <ListBoxItem> <StackPanel Margin="10,5,0,0" Name="Stack1" Orientation="Horizontal"> <Image Margin="10,0,0,0" Name="Img1" Height="15"></Image> ...

How to clear TextBlock.

Im adding text TextBlock Text1,Text2,Text3 in Adddata() fucntion as follow. if (i == 0) { Text1.Text = tagname.AlarmTag; } if (i == 1) { Text2.Text = tagname.AlarmTag; } if (i == 2) { Text3.Text = tagname.AlarmTag; } Now in deletedata() i want to clear all contents in three textblock. How can i do that?because i cannot fin...

Styling both Hyperlink and TextBlock with a single style?

I have two types of text that need to follow similar coloring rules based on an enumeration: public enum Modes { A, B, C } A Style with DataTrigger markup is used to colorize: <Style TargetType="SEE BELOW" x:Key="Coloring"> <Style.Triggers> <DataTrigger Binding="{Binding Path=.}" Value="...

Scroll text in a textblock from code behind

i need to scroll the textblock text. For example, the textblock contains 700 words. These words are populated to the textblock from code behind as it could be a different 700 words depending on some "stuff". There is a textbox on this form as well. The user types the words in the textblock into the textbox. As they type i keep track...

Silverlight 3 scroll textblock in code

i need to scroll the textblock text. For example, the textblock contains 700 words. These words are populated to the textblock from code behind as it could be a different 700 words depending on some "stuff". There is a textbox on this form as well. The user types the words in the textblock into the textbox. As they type i keep track of w...

WPF, how to override an application wide style on textblocks on specific places

I have a style xaml resource dictionary which is added in Application.xaml. In that style file I specify that all textblocks should have the foreground white. The problem is that this will change the combobox items foreground to white in a usercontrol I have in the same application. I want the items to have a black foreground in all or o...

Add textblock to ellipse in WPF

How to add a TextBlock to an Ellipse in WPF/Silverlight? ...

WPF begin fontsize animation of a textblock from C#

Hi! I would like to start a fontsize animation of a textblock from C# code. How can I do this? I want increase/decrease fontsize during a period of 1 second. Thanks! ...

Current Date in Silverlight XAML TextBlock

I am coming from Flex where you can do just about anything inside of curly braces. I am trying to get a TextBlock to display today's Date and Time without just coding it in C#. I have tried many different variations of the following with no luck. TextBlock Text="{Source=Date, Path=Now, StringFormat='dd/MM/yyyy'}" I know I could probab...

Is this slow WPF TextBlock performance expected?

Hi, I am doing some benchmarking to determine if I can use WPF for a new product. However, early performance results are disappointing. I made a quick app that uses data binding to display a bunch of random text inside of a list box every 100 ms and it was eating up ~15% CPU. So I made another quick app that skipped the data binding/...

How to get a TextBlock to wrap text inside a DockPanel area?

What do I have to do to get the inner TextBlock below to wrap its text without defining an absolute width? I've tried Width=Auto, Stretch, TextWrapping, putting it in a StackPanel, nothing seems to work. XAML: <UserControl x:Class="Test5.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="ht...

How to get TextBlock with background color to fill 100% of surround DockPanel's width

I'm using the Expander control from the Silverlight toolkit, and I would like the header to have a specific background colour across the whole width. What I'm really aiming for is to mimic our old ASP.NET-based CollapsiblePanelExtender, from the AJAX control toolkit. It should be mentioned that I want the expand/collapse icon to appear ...