在WinForms中的幻灯片显示应用程序中使图像全屏显示 [英] Making the image go full screen in slideshow application in winforms

查看:64
本文介绍了在WinForms中的幻灯片显示应用程序中使图像全屏显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于图像幻灯片显示的winforms应用程序.我使用一个列表来存储图像路径列表,使用图片框显示图像并单击[幻灯片显示]按钮.但是我有一个全屏图像问题...单击幻灯片放映时,图像应在全屏模式下打开,就像Windows图像查看器一样.请帮助我,请记住,只有图像应该全屏显示.而不是完整表格.

I have an winforms application for slideshow of images.im using a list for storing the list of image paths,picture box to display image and on click of [slideshow] button..the slideshow happens...everything is working fine but i have one problem with full screen of image... on click of slideshow,image should open in full screen same like windows image viewer. please help me,keep in mind,only image should go full screen.not the full form.

在几乎所有站点中我都得到了下面的代码,但是Windowstate显示了一个错误.

i got below code in almost all the sites but Windowstate shows an error.

            targetForm.WindowState = FormWindowState.Maximized;
            targetForm.FormBorderStyle = FormBorderStyle.None;
            targetForm.TopMost = true;
            targetForm.Bounds = Screen.GetBounds(targetForm);

请帮帮我.预先感谢.

推荐答案

我认为您正在尝试对窗口模式和全屏模式使用不同的布局.

I think you are trying to use different layouts for windowed and full screen mode.

切换到全屏模式时,您可以:

When you switch to full screen you can:

  • 以编程方式更改 PictureBox pictureBox.Dock = DockStyle.Fill
  • 填写表单
  • 打开另一个表单(全屏显示),该表单仅包含填充该表单的 PictureBox

注意:如果您将Dock设置为除 DockStyle.None

Note: First method won't work as expected if you have other controls with Dock set to something else than DockStyle.None

这篇关于在WinForms中的幻灯片显示应用程序中使图像全屏显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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