using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace UAS_LabelMachine { public partial class PreViewWindow : Form { string FileName; public PreViewWindow(string filename) { InitializeComponent(); FileName = filename; } private void PreViewWindow_Load(object sender, EventArgs e) { LabelPreView.Image = Image.FromFile(@"C:\打印标签\"+FileName+".jpg"); } private void PreViewWindow_FormClosed(object sender, FormClosedEventArgs e) { LabelPreView.Image = null; } } }