控制滚动查看器 [英] controlling the scrollviewer

查看:83
本文介绍了控制滚动查看器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面中有滚动查看器。 scrollviewer的内容在运行时会有所不同。如果内容更多,则应滚动,否则不应滚动。我也有类似的方式。                      
                

I have scrollviewer in my page. The content of scrollviewer will vary at runtime. If content is more it should scroll, otherwise it should not scroll. I have placed similar way.                                       

 < ScrollViewer Name =" scrol"高度= QUOT; 300"   VerticalScrollBarVisibility =" Auto">

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; <网格>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < TextBlock Name =" lblPageName" Text =" fghfghfhgfhfgh&fbsp; gfhfgh hgf fhhgfh TextWrapping = QUOT;包覆与QUOT;
  FontSize =" 45" />

 <ScrollViewer Name="scrol" Height="300"  VerticalScrollBarVisibility="Auto">
                    <Grid >
                        <TextBlock Name="lblPageName" Text="testing fghfghfhgfhfgh  gfhfgh hgf fhhgfhgfhf fghgfhf fghfghf fgh ghfggfhgfhgfh fghfgh " TextWrapping="Wrap"  FontSize="45"/>

< TextBox>< / TextBox> &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP;  < / Grid>

  &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < / ScrollViewer>

<TextBox></TextBox>                    </Grid>
                </ScrollViewer>

滚动。即使lblPageName长度的文本非常少,它也表现为滚动运动。我需要压制滚动动作。  我使用了scrol.scrollableheight检查,但它总是给我0.请让我知道如何解决这个
问题。

It is scrolling. Even if the Text of lblPageName length is very less, it is behaving scroll movement. I need to supress the scroll movement.  I have used scrol.scrollableheight check, but it is giving me always 0. Please let me know how to solve this issue.

推荐答案

只需将scrollviewer的高度设为auto并尝试.........

Just give the height of the scrollviewer as auto and try.........

干杯:)


这篇关于控制滚动查看器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆