Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 123213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:15:03+00:00 2026-05-11T04:15:03+00:00

Why does the text in my TextBlock extend out to the right beyond my

  • 0

Why does the text in my TextBlock extend out to the right beyond my canvas even though I specified word wrap?

<Window x:Class='WpfApplication6.Window1'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     Title='Window1' SizeToContent='WidthAndHeight'>     <DockPanel>         <StackPanel DockPanel.Dock='Top' Orientation='Horizontal'>             <Button Content='111'/>             <Button Content='222'/>             <Button Content='333'/>             <Button Content='444'/>             <Button Content='555'/>         </StackPanel>         <StackPanel DockPanel.Dock='Left'>             <Button Content='One'/>             <Button Content='Two'/>             <Button Content='Three'/>             <Button Content='Four'/>             <Button Content='Five'/>         </StackPanel>         <Canvas Background='tan'>             <TextBlock TextWrapping='Wrap'>This is the content in this area here</TextBlock>         </Canvas>     </DockPanel> </Window> 

SOLUTION: Thanks, Steve, that did it, I added a ScrollViewer as well, nice:

<DockPanel>     <StackPanel DockPanel.Dock='Top' Orientation='Horizontal'>         <Button Content='111'/>         <Button Content='222'/>         <Button Content='333'/>         <Button Content='444'/>         <Button Content='555'/>     </StackPanel>     <StackPanel DockPanel.Dock='Left'>         <Button Content='One' Click='Button_Click' />         <Button Content='Two'/>         <Button Content='Three'/>         <Button Content='Four'/>         <Button Content='Five'/>     </StackPanel>     <Grid Background='tan'>         <ScrollViewer>             <TextBlock Name='mainArea' Padding='10' TextWrapping='Wrap'>This is the content in this area here</TextBlock>         </ScrollViewer>     </Grid> </DockPanel> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:15:04+00:00Added an answer on May 11, 2026 at 4:15 am

    It’s inside a Canvas, so it’s not getting any width set. If you don’t need the canvas, change it to a Grid (which automatically sizes itself) and the TextBlock will wrap properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does FindName() return null in the following example? XAML: <Window x:Class=TestDynamicTextBox343.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
<Window xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml DataContext=This is my text> <TextBlock> <Run Text={Binding}/> </TextBlock> </Window> Throws InvalidOperationException
Why TextBlock remains black? <Window x:Class=WpfApplication4.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow Height=350 Width=525> <Window.Resources> <Style TargetType=TextBlock
I'm using a phone API called Twilio and it does text to voice. I'm
I'm tracking how fast does the text of a textArea change. If it changes
I want to create a page with 2 independent columns. If the text does
Does Git store text compressed with Gzip as binary files or can it tell
Does anybody know how to programmatically set the text of a button? thing is
Does a tool exist that can parse text and output that text, hyper-linked to
Does it make sense that if the Text on a TextBox is databound to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.