private void button_LoadSHP_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "Load SHP"; ofd.InitialDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); if (!string.IsNullOrEmpty(InitialDirectory)) { ofd.InitialDirectory = this.InitialDirectory; } if (Cinimanager.inisettings.LastFireFLHFinderDirectory != "") { ofd.InitialDirectory = Cinimanager.inisettings.LastFireFLHFinderDirectory; } ofd.FileName = ""; ofd.Filter = "SHP(TS) files|*.shp"; ofd.Multiselect = true; if (ofd.ShowDialog() == DialogResult.OK) { if (!CSHaPer.IsSHP(ofd.FileName)) { MessageBox.Show("No valid SHP file!"); return; } SHPFile = ofd.FileName; Cinimanager.inisettings.LastFireFLHFinderDirectory = System.IO.Path.GetDirectoryName(ofd.FileName); CImageFile[] _SHPFrames = CSHaPer.GetFrames(ofd.FileName, 0); int oldleft = (int)this.numericUpDown_FrameLeft.Value; int oldright = (int)this.numericUpDown_FrameRight.Value; this.numericUpDown_FrameLeft.Value = 0; this.numericUpDown_FrameRight.Value = 0; this.numericUpDown_FrameLeft.Maximum = _SHPFrames.Length - 1; this.numericUpDown_FrameRight.Maximum = _SHPFrames.Length - 1; if (oldleft < this.numericUpDown_FrameLeft.Maximum) { this.numericUpDown_FrameLeft.Value = oldleft; } if (oldright < this.numericUpDown_FrameRight.Maximum) { this.numericUpDown_FrameRight.Value = oldright; } UpdateImages(); } }