导航用户控件 [英] Navigate User Control

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

问题描述

我有一个内部带有用户控件的表单,该表单具有通过读取xml文件加载的图像.我想知道当加载的图像占用了用户控件内超出表单大小的更多空间时,用户控件是否有可能扩展?是否存在用于扩展用户控件并可以在表单内部进行导航的代码?帮帮我,谢谢:)

请不要发表无关的评论.

I have a form with a user control inside that has images loaded from reading xml file. I want to know if there is a possibility that user control may expand when the loaded images are consuming more spaces inside the user control that it exceed to the size of the form? Is there a code for making the user control expand and can be navigated inside the form? Help me, Thanks :)

Please don''t post irrelevant comments.

推荐答案

好吃,

您还记得我向您展示的用于创建图片框的示例代码吗?我使用面板作为容器控件-并使用了AutoScroll.
因此,滚动是我想到的第一个解决方案.
添加更多图片时,也许还可以调整容器(面板)的大小.只需测量尺寸,对其进行汇总,然后计算并分配容器的新尺寸,然后让用户滚动即可.

就像我说的.还有另一种涉及Paint and Resize事件处理的解决方案.因此,您可以选择完全控制控件的布局和绘图(但这可能非常复杂).

在进一步解决问题之前,也许您告诉我们我真正想要做的事情?

据我记得:

*您从xml阅读图像路径
*您为所有图像创建一个容器控件
*您将图像添加到容器中并对其进行布局

但是,您希望用户对图片进行处理.这是某种缩略图控件,查看器还是选择器,还是什么?我想您可以为所有这类图片控件"找到很多很好的例子...

祝你好运!
hi yummy,

You remember the example code I showed you for creating the picture boxes? I used a panel as container control - and used AutoScroll.
So Scrolling is the first solution that comes to my mind.
Maybe you can also resize the container (Panel) when adding more pictures. Just Meassure the sizes, sum them up and calculate and assign the new size of the container, then let the user scroll.

As I said. There is another solution involving Paint and Resize event handling. So you have the option to completly control the layout and drawing of your control (but this can be quite complicated).

Before fiddling any longer with your problem, maybe you tell us(me) just what you really want to do?

As far as I remember:

* You read Image-Paths from xml
* You create a Container-Control for all images
* You add the images to the container and layout them

But what you want the user do with the pictures. Is this some kind of thumbnail control, viewer or a picker or what? I guess you can find a lot of good examples for all those kinds of "Picture-Controls"...

Good luck!


这篇关于导航用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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