Questions tagged [texttrimming]

78 questions
121
votes
15 answers

Truncate string in Laravel blade templates

Is there a truncate modifier for the blade templates in Laravel, pretty much like Smarty? I know I could just write out the actual php in the template but i'm looking for something a little nicer to write (let's not get into the whole PHP is a…
fl3x7
  • 3,723
  • 6
  • 26
  • 37
28
votes
3 answers

TextTrimming with Ellipsis and a Colon

This is a relatively simple question: I can trim a text with ellipsis using this: it would give me something along the lines of: "This sentence is too long" => "This sentence…
FZdev
  • 418
  • 1
  • 5
  • 10
27
votes
7 answers
24
votes
5 answers

Get Displayed Text from TextBlock

I have a simple TextBlock defined like this
Fredrik Hedblad
  • 83,499
  • 23
  • 264
  • 266
22
votes
4 answers

TextTrimming from left

Is there a way to specify text trimming on a TextBlock to be from the left side? I've manage to accomplish two out of three scenarios (the third being the one I need): Regular trimming
Boris
  • 9,986
  • 34
  • 110
  • 147
11
votes
2 answers

Inline object in TextBlock with TextTrimming = CharacterEllipsis or WordEllipsis

If you run this code and minimize/maximize width of the window
Maxim Kapitonov
  • 475
  • 4
  • 9
11
votes
4 answers

How to display too long text properly in WPF ComboBox

I have a ComboBox that shows text of various lengths. For texts that are not long there is not a problem. For the texts longer than the width of ComboBox I would like to trim the text and add "..." (an ellipsis) at the end to show them properly. The…
bilgestackoverflow
  • 329
  • 1
  • 6
  • 24
10
votes
2 answers

WPF: TextTrimming on a ContentPresenter

Is there a simple way to just get TextTrimming to work with a ContentPresenter? I have implict styles for TextBlock and AccessText that have TextTrimming set to CharacterEllipsis, but it's not picked up by the ContentPresenter. I can change the…
dex3703
  • 2,077
  • 4
  • 28
  • 45
8
votes
1 answer

Textblock.TextTrimming not working inside a grid

I have a 3 column grid for my layout with each of it width set to Width="*". For the middle (2nd) grid, I have another 3 column grid each containing it own textblock, and again the column grids width are set to Width="*". When the Window is resized,…
Daniel Clark
  • 615
  • 2
  • 9
  • 17
5
votes
1 answer

XAML - TextTrimming does not work with LineBreaks?

How come TextTrimming works on the first TextBlock and NOT on the second one? I am using LineBreaks on my xaml, which is part of the text I need to display. Code:
Flip Booth
  • 271
  • 3
  • 11
4
votes
5 answers

How to remove the protocol and domain from a url string?

I am running the following code in PHP. My intention is to get "contact.html" in the response, but what I actually get in the output is ntact.html $str = 'http://localhost/contact.html'; echo $str . "
"; echo ltrim($str,'http://localhost'); Any…
Varun Verma
  • 704
  • 2
  • 10
  • 20
4
votes
1 answer

ComboBox TextWrap Binding

I have the following ComboBox
Prat
  • 495
  • 7
  • 19
3
votes
4 answers

How to trim $_SERVER['HTTP_REFERER']

After from processing i am sending the user on the previous page using: header('Location: ' . $_SERVER['HTTP_REFERER'] . '?Add=Successful'); Now it sends me to my add.php: http://localhost/add.php?Add=Successful Again when i add one more data the…
Django Anonymous
  • 2,987
  • 16
  • 58
  • 106
3
votes
1 answer

How to get Textblock with TextTrimming over an AdornedElementPlaceholder?

I'm trying to get a ValidationRule to display text over an offending combobox, if the user has not specified a value yet. I can get it to display, but I can't seem to get the text to fit to the size of the combobox using…
Tam Bui
  • 2,940
  • 2
  • 18
  • 27
3
votes
2 answers

Silverlight: Button template with texttrimming cut off

I'm replacing the default Button template's ContentPresenter with a TextBlock, so the text can be trimmed when it's too long. Works fine in WPF. In Silverlight the text gets pushed to one edge and cut off on the left, even when there's space on the…
dex3703
  • 2,077
  • 4
  • 28
  • 45
1
2 3 4 5 6