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 7570077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:19:43+00:00 2026-05-30T15:19:43+00:00

I have a user control that inside has a TextBlock (textmsg), the following is

  • 0

I have a user control that inside has a TextBlock (textmsg), the following is the xaml file

<UserControl x:Class="XXXXX.MyMsgBox"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="400" d:DesignWidth="480">

    <Grid x:Name="LayoutRoot" Background="#FF000000">

        <StackPanel HorizontalAlignment="Left" Name="stackPanel2" VerticalAlignment="Top" Margin="10">

            <TextBlock Margin="10" Name="textmsg" Text="{Binding Path=LocalizedResources.wb_msg, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" />

            <StackPanel Name="stackPanel1" Orientation="Horizontal">
                <Button Width="140" Content="{Binding Path=LocalizedResources.set_wb, Source={StaticResource LocalizedStrings}}" Name="button1" Click="button1_Click" FontSize="22" />
                <Button Width="170" Content="{Binding Path=LocalizedResources.default_wb, Source={StaticResource LocalizedStrings}}" Name="button2" FontSize="22" />
                <Button Width="140" Content="{Binding Path=LocalizedResources.cancel, Source={StaticResource LocalizedStrings}}" Height="72" Name="button3" FontSize="22" />
            </StackPanel>

        </StackPanel>

    </Grid>

</UserControl>

then in C# I use the following code to display the popup

    Popup popup = new Popup();
    MyMsgBox mmb = new MyMsgBox(popup);
    popup.Height = 400;
    popup.VerticalOffset = 328;
    popup.HorizontalOffset = 0;
    popup.Child = mmb;
    popup.IsOpen = true;

but the text inside textmsg isn’t wrapped, why ? What is wrong?

Best regards.

  • 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. Editorial Team
    Editorial Team
    2026-05-30T15:19:45+00:00Added an answer on May 30, 2026 at 3:19 pm

    You should set the MaxWidth property on the parent (StackPanel) of your TextBlock (textmsg). StackPanel sizes to whatever its content asks for, and gives free reign for the content to ask for anything. Thus, the TextBlock asks for the full width of the text with no wrapping.

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

Sidebar

Related Questions

I have a User Control that has some WinForm Controls inside. I want to
i have a user control that descends from UserControl. When dropped onto the form
I have a user control that has a few public properties, one is an
I have a user control that contains a GridView. The GridView has both a
I have written a user control that captures some user input and has a
I have a XAML code that should load my UserControl inside the TabControl .
I have a datalist inside a usercontrol that gets loaded into a page where
I have a user control that is pretty basic. It contains several TextBox controls,
I have a user control that I'm building. It's purpose is to display the
I have a user control that I've created, however when I go to add

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.