面板高度 [英] Panel Height

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

问题描述

使用.NET 1.1窗体


我想一个接一个地在面板控件上放置400多张图片

一个用户可以滚动浏览它们,但是每张图片高达200像素,总共超过80,000像素,但是面板控制最多可以达到32767像素。如何允许用户滚动浏览所有400张
图片?

谢谢

彼得

Using .NET 1.1 Window Forms

I would like to place over 400 pictures on a panel control one after another
one so user can scroll through them, but each picture is up to 200 pixels in
height that''s over 80,000 pixels in total, but panel control can go up to
only 32767 pixels. How can I allow a user to scroll through all of the 400
pictures?
Thanks
Peter

推荐答案

怎么说,只是一些图片和一个说更多......的链接。当他们点击它时,你删除现有图片并用原始列表中最后一个后面的

图片刷新它?您甚至可以设置

两个链接Next和上一个。这样看起来会更加用户友好。

Peter


-

联合创始人,Eggheadcafe.com开发人员门户网站:
http://www.eggheadcafe.com

UnBlog:
http://petesbloggerama.blogspot.com


" Peter"写道:
How about say, just a few pictures and a link that says "more..." and when
they click it, you delete the existing pictures and refresh it with the
puctures that follow the last one in the original list? You could even set up
two links "Next" and "Previous". Seems like that would be more user-friendly.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Peter" wrote:

使用.NET 1.1窗体


我想在一个面板控件上放置400多张图片另一个

一个用户可以滚动浏览它们,但是每张图片最多200个像素,总价值超过80,000像素,但面板控制可以去最高

仅32767像素。如何允许用户滚动浏览所有400张
图片?


谢谢


Peter
Using .NET 1.1 Window Forms

I would like to place over 400 pictures on a panel control one after another
one so user can scroll through them, but each picture is up to 200 pixels in
height that''s over 80,000 pixels in total, but panel control can go up to
only 32767 pixels. How can I allow a user to scroll through all of the 400
pictures?
Thanks
Peter




" Peter Bromberg [C#MVP]" < pb ******* @ yahoo.nospammin.com写信息

新闻:C7 ********************* ************* @ microsof t.com ...

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:C7**********************************@microsof t.com...

怎么说,只是几张图片和一个链接说"更..."当他们点击它时,你删除现有图片并用原始列表中最后一个后面的

图片刷新它?你甚至可以设置



两个链接下一步和上一个。好像那样会更好

用户友好。

彼得


-

Co -founder,Eggheadcafe.com开发者门户网站:
http://www.eggheadcafe.com

UnBlog:
http://petesbloggerama.blogspot。 com


" Peter"写道:
How about say, just a few pictures and a link that says "more..." and when
they click it, you delete the existing pictures and refresh it with the
puctures that follow the last one in the original list? You could even set
up
two links "Next" and "Previous". Seems like that would be more
user-friendly.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Peter" wrote:

>使用.NET 1.1窗体

我想在一个面板控件上放置超过400张图片另一个
一个用户可以滚动浏览它们,但每张图片最多可达200​​像素
高度总共超过80,000像素,但面板控制可以达到
只有32767像素。如何让用户滚动浏览所有图片?

谢谢

彼得
>Using .NET 1.1 Window Forms

I would like to place over 400 pictures on a panel control one after
another
one so user can scroll through them, but each picture is up to 200 pixels
in
height that''s over 80,000 pixels in total, but panel control can go up to
only 32767 pixels. How can I allow a user to scroll through all of the
400
pictures?
Thanks
Peter



感谢您的帮助


这对于网络应用程序来说是一个很好的建议,但是我需要的东西将是/ b
允许用户滚动浏览许多图片。如果我有400张图片

并且用户一次只能在屏幕上看到3或4张图片

想想用户必须点击多少次下一个按钮获得第44张照片的

Thanks for your help

This would be good suggestion for a web app, but I need something that will
allow user to scroll through many pictures. If I have 400 hundred pictures
and the user can see only 3 or 4 pictures on the screen at one time just
think how many times the user would have to click on the Next button to get
to the 400th picture.


嗨彼得,


从那以后'是Panel'的高度限制,我建议你每次加载一张

图片,例如点击上一页按钮。按钮或

下一步按钮。


我们可以将所有图片放在一个文件夹中,并使用DirectoryInfo类的

GetFileSystemInfos方法来获取信息

此文件夹中的所有文件,包括这些文件的总数和每个文件的文件名
。然后我们可以轻松地在我们的

计划中浏览所有这些文件。


以下是一个示例。它要求你设置一个Windows

应用程序并将一个PictureBox,两个标签和两个按钮拖放到

表格上。


使用System.IO;


公共类Form1:System.Windows.Forms.Form

{


FileSystemInfo [] infos;

int position = -1;


private void Form1_Load(object sender,System.EventArgs e)

{

DirectoryInfo目录=新的DirectoryInfo(@C:\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\

{

infos = dir.GetFileSystemInfos(" * JPG");

this.label1.Text = infos.Length.ToString( );

if(infos.Length 0)

{

button2_Click(发件人,e);

}

}

其他

{

this.label1.Text =" 0";

}

}

//点击button1导航到上一张图片

private void button1_Click(o bject sender,System.EventArgs e)

{

if(position 0)

{

position-- ;

this.pictureBox1.Image = Image.FromFile(infos [position] .FullName);


}

这个。 label2.Text =(position + 1).ToString();

}

//点击button1导航到下一张图片

private void button2_Click(object sender,System.EventArgs e)

{

if(position< infos.Length - 1)

{

位置++;

this.pictureBox1.Image = Image.FromFile(infos [position] .FullName) ;

}

this.label2.Text =(位置+ 1).ToString();

}

希望这会有所帮助。

如果您认为我的解决方法不适合您的情况,请感觉

免费让我知道。 />
此致,

Linda Liu

Microsoft在线社区支持


======== ==========================================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========


此帖子按原样提供。没有保证,也没有授予任何权利。

Hi Peter,

Since there''s a limitation of Panel''s Height, I recommend you to load a
picture once a time, for example by clicking on a "Previous" button or a
"Next" button.

We could place all the pictures in a folder and make use of the
GetFileSystemInfos method of the DirectoryInfo class to get the information
of all files in this folder, including the total count of these files and
each file''s file name. Then we could navigate among all these files in our
program easily.

The following is a sample. It requires that you have set up a Windows
application and drag&drop a PictureBox, two Labels and two buttons onto the
form.

using System.IO;

public class Form1 : System.Windows.Forms.Form
{

FileSystemInfo[] infos;
int position = -1;

private void Form1_Load(object sender, System.EventArgs e)
{
DirectoryInfo dir = new DirectoryInfo(@"C:\private\others\picures");
if (dir.Exists)
{
infos = dir.GetFileSystemInfos("*JPG");
this.label1.Text = infos.Length.ToString();
if (infos.Length 0)
{
button2_Click(sender, e);
}
}
else
{
this.label1.Text = "0";
}
}
// click on button1 to navigate to the previous picture
private void button1_Click(object sender, System.EventArgs e)
{
if (position 0)
{
position--;
this.pictureBox1.Image = Image.FromFile(infos[position].FullName);

}
this.label2.Text = (position + 1).ToString();
}
// click on button1 to navigate to the next picture
private void button2_Click(object sender, System.EventArgs e)
{
if (position < infos.Length - 1)
{
position++;
this.pictureBox1.Image = Image.FromFile(infos[position].FullName);
}
this.label2.Text = (position + 1).ToString();
}

Hope this helps.
If you don''t think my workaround is suitable to your scenario, please feel
free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


这篇关于面板高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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