滚动查看器和画布的问题
我有一个自定义的 canvas
控件,它位于 scrollviewer
内 - 我已经实现了 canvas
上的项目的拖放和移动,并覆盖了 >MeasureOverride
这样,当我在画布上移动项目时,其大小会反映更改,因此,如果我将项目移动到画布的可见部分之外,它将调整大小以适应移动的项目,并且滚动条将适当显示。
但是,如果我随后使用滚动条将项目放入视图中,然后开始再次将项目移回视图中,滚动条就会变得有点失控。
我担心这对问题的解释相当糟糕,但我不知道还能怎么说,但希望它能包含足够的信息,让有人为我指明正确的方向。
I have a custom canvas
control which sits inside a scrollviewer
- I have implemented drag, drop and move for items on the canvas
and overridden MeasureOverride
so that when I move an item around on the canvas its size reflects the changes so if I move the item beyond the visible portion of the canvas it will resize to accommodate the moved item and scrollbars will show appropriately.
However if I then bring the item into view by using the scrollbars then start to move the item back out again the scrollbars go a bit haywire.
It's a rather poor explanation of the problem I afraid but I am not sure how else to put it but hopefully it will contain enough info for somebody to point me in the right direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,你是对的,需要对问题进行更多解释。尽管我也遇到了
Canvas
和scroll-viewer
的很多问题,但请查看这个问题以了解我遇到的问题以及我如何解决该问题 -< a href="https://stackoverflow.com/questions/3061400/scrollbars-are-not-visible-after-change-positions-of-controls-inside-a-canvas">更改控件位置后滚动条不可见在画布内
Yes you are right, more explanation of problem is required. Although I was also in a situation where I faced a lot of issues with
Canvas
andscroll-viewer
, look at this question for problems I faced and how I solved that -ScrollBars are not visible after changing positions of controls inside a Canvas