Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you trying to make a single paragraph that wraps? If so, then <code>WrapPanel</code> isn't actually what you want.</p> <p><code>WrapPanel</code> takes UI elements (rectangular chunks of real estate) and lays them out left-to-right, top-to-bottom. You could enable wrapping in your first <code>TextBlock</code>, but then it'll take up a rectangle of screen space that's two lines high. Because the <code>TextBlock</code> fills that entire rectangle, the button will actually appear <em>under</em> it, rather than to the right of the bold words "for testing ".</p> <p>If you want to make the whole thing flow like a paragraph, you don't want to use <em>UI</em> elements (which are always rectangular chunks); you want to use <em>text</em> elements (which flow in paragraphs).</p> <p>The way to get text elements into your XAML is to wrap them in a <code>TextBlock</code>. Try this:</p> <pre><code>&lt;Grid&gt; &lt;TextBlock TextWrapping="Wrap"&gt; &lt;Bold&gt; &lt;Run Text="Very long Text Message contains long text for testing " /&gt; &lt;/Bold&gt; &lt;Button Content="sample Text"&gt;&lt;/Button&gt; sample Text textblock &lt;/TextBlock&gt; &lt;/Grid&gt; </code></pre> <p>Note that I wrapped the first chunk of text in a <code>&lt;Run&gt;</code> element -- otherwise the trailing space would be ignored (assumed to be whitespace in your XAML document). The second chunk of text didn't have leading or trailing spaces, so I just put it directly inline.</p> <p><a href="https://stackoverflow.com/a/1252560/87399">This answer</a> has a bit more about the difference between the "controls" and "text" sides of XAML.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload