private void frmPointer_Add_Load(object sender, EventArgs e) { var setting = HelperSetting.GetSetting(); if (setting != null && !string.IsNullOrEmpty(setting.FolderPointer)) { string[] strs = Directory.GetFiles(setting.FolderPointer); ImageList lst = new ImageList(); foreach (var str in strs) { if (str.LastIndexOf(".jpg") > 0 || str.LastIndexOf(".JPG") > 0) { listView1.Items.Add(str.Replace(setting.FolderPointer + "\\", ""), lst.Images.Count); lst.ImageSize = new System.Drawing.Size(80, 80); lst.Images.Add(ResizeImage(80, 80, str)); } } listView1.LargeImageList = lst; } }
private void frmSetting_Load(object sender, EventArgs e) { var setting = HelperSetting.GetSetting(); if (setting != null) { if (!string.IsNullOrEmpty(setting.FileData)) { txtFileData.Text = setting.FileData; } if (!string.IsNullOrEmpty(setting.FolderBackground)) { txtFolderBackground.Text = setting.FolderBackground; } if (!string.IsNullOrEmpty(setting.FolderPointer)) { txtFolderPointer.Text = setting.FolderPointer; } } }
private void frmMain_Load(object sender, EventArgs e) { try { HelperSetting.SetFilePath(Application.StartupPath + "\\" + HelperSetting.FileName); var setting = HelperSetting.GetSetting(); if (string.IsNullOrEmpty(setting.FileData) || string.IsNullOrEmpty(setting.FolderBackground) || string.IsNullOrEmpty(setting.FolderPointer)) { var frm = new frmSetting(); frm.ShowDialog(); } HelperImage.Load(); mnuLibrary.Text = string.Format("Library ({0})", HelperImage.List().Count); } catch (Exception ex) { MessageBox.Show(ex.Message); this.Close(); } }