C#windows phone 8 app段

时间:2014-03-19 16:49:10

标签: c# windows-phone-8 scrollviewer

您好我是Windows Phone应用开发的新手。我现在正在开发一个显示一段文字的应用程序。我使用滚动查看器来显示文本。我已将整个段落放在一个文本块中。问题是当我运行应用程序时,模拟器只显示文本的一半,剩下的一半是不可见的,如何使段落内的所有文本都可见?谢谢

4 个答案:

答案 0 :(得分:0)

尝试设置

TextWrapping="Wrap" on TextBlock

还要确保scrollviewer大小未设置为“自动”,因为它将继续扩展以容纳文本。尝试给出屏幕宽度大小。

答案 1 :(得分:0)

使用:

<ScrollViewer>
    <TextBlock Text="Your paragraph here" TextWrapping="Wrap" /> 
</ScrollViewer>

答案 2 :(得分:0)

您好,您可以使用RichTextBox:

<RichTextBox FontSize="25" Background="Transparent"> <Paragraph> your text goes here. </Paragraph> </RichTextBox>

答案 3 :(得分:0)

只需添加以下代码。

XAML代码:

try
{
    Class.forName("com.mysql.jdbc.Driver");
    Connection conn=(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/Hotel_management"+"root"+"1234");
    Statement stmt=conn.createStatement();
    String query="insert into Records(Name, Address, Contact_no, Email, Nationality) values('"+name+"','"+add+"','"+con+"','"+e_mail+"','"+nat+"');";
    stmt.executeQuery(query);
}
catch(Exception e)
{
    JOptionPane.showMessageDialog(this, e.getMessage());
}

班级代码: -

<ScrollViewer Grid.Row="1">
   <StackPanel>                
       <RichTextBox x:Name="richTxtBox" VerticalAlignment="Top"  Style="{StaticResource NormalRichTextBoxStyle}"/>
   </StackPanel>
</ScrollViewer>