全屏显示一个图片文件
CSDN上的一个小问题,我这里突然就不能上CSDN了,那位兄弟到这里看吧。
要借助一个窗体和一个PictureBox,窗体的FormBorderStyle设置为None
PictureBox的SizeMode设置为StretchImage
然后代码超级简单。
要借助一个窗体和一个PictureBox,窗体的FormBorderStyle设置为None
PictureBox的SizeMode设置为StretchImage
然后代码超级简单。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Picture_Example
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
private void frmMain_Load(object sender, EventArgs e)
{
this.Bounds = Screen.PrimaryScreen.Bounds;
pictureBox1.Bounds = Screen.PrimaryScreen.Bounds;
}
private void pictureBox1_DoubleClick(object sender, EventArgs e)
{
this.Close();
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Picture_Example
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();
}
private void frmMain_Load(object sender, EventArgs e)
{
this.Bounds = Screen.PrimaryScreen.Bounds;
pictureBox1.Bounds = Screen.PrimaryScreen.Bounds;
}
private void pictureBox1_DoubleClick(object sender, EventArgs e)
{
this.Close();
}
}
}