Microsoft Developer Network > Forenhomepage > Windows Presentation Foundation (WPF) > Can a RadioButton's content be word-wrapped?
Stellen Sie eine FrageStellen Sie eine Frage
 

BeantwortetCan a RadioButton's content be word-wrapped?

Antworten

  • Mittwoch, 4. November 2009 17:51William Han - MSFT TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet
    Does markup below work for you?

            <RadioButton>
                <RadioButton.Content>
                    <TextBlock Grid.Row="2" FontSize="28" TextWrapping="Wrap" Foreground="Navy" HorizontalAlignment="Stretch" >Some loooooooooooooong Question?</TextBlock>
                </RadioButton.Content>
            </RadioButton>

    William
  • Mittwoch, 4. November 2009 17:55KP_SES TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     BeantwortetEnthält Code
    Sure, the beauty of WPF is the content can be set to another UIElement.  TextBlock supports TextWrapping.

      <RadioButton>
            <TextBlock TextWrapping="Wrap" Height="31" Width="73">Here Is Some Wrapped Text</TextBlock>
      </RadioButton>

Alle Antworten

  • Mittwoch, 4. November 2009 17:51William Han - MSFT TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     Beantwortet
    Does markup below work for you?

            <RadioButton>
                <RadioButton.Content>
                    <TextBlock Grid.Row="2" FontSize="28" TextWrapping="Wrap" Foreground="Navy" HorizontalAlignment="Stretch" >Some loooooooooooooong Question?</TextBlock>
                </RadioButton.Content>
            </RadioButton>

    William
  • Mittwoch, 4. November 2009 17:55KP_SES TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     BeantwortetEnthält Code
    Sure, the beauty of WPF is the content can be set to another UIElement.  TextBlock supports TextWrapping.

      <RadioButton>
            <TextBlock TextWrapping="Wrap" Height="31" Width="73">Here Is Some Wrapped Text</TextBlock>
      </RadioButton>