private void open_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { CreateWindow(OpenDialog.FileName); } }
void OnFileViewAdd(object sender, EventArgs e) { if (OpenDialog.ShowDialog(this) == DialogResult.OK) { FileAdd(OpenDialog.FileNames, false); } }
private void AlbumArt_Click(object sender, EventArgs e) { if (!Writable || Song == null) { return; } OpenDialog.Multiselect = false; OpenDialog.Title = "Select album art"; OpenDialog.Filter = "Common Image Files|*.png;*.jpg;*.bmp|All Files|*"; if (OpenDialog.ShowDialog(this) == DialogResult.Cancel) { return; } Bitmap image = null; try { image = new Bitmap(OpenDialog.FileName); } catch { } if (image != null) { Song.AlbumArt = image; } AlbumArt.Image = image; }
/// <summary> /// Opening open file dialog /// </summary> public void OpenFileDialog() { OpenDialog.Filter = "Excel Files| *.xls; *.xlsx"; OpenDialog.ValidateNames = true; OpenDialog.CheckFileExists = true; OpenDialog.ShowDialog(); }
private void bcreaodf_Click(object sender, EventArgs e) { OpenDialog.Filter = "DOCX Files|*.docx|All Files|*.*"; OpenDialog.Multiselect = false; OpenDialog.FileName = ""; if (OpenDialog.ShowDialog() == DialogResult.OK) { //CARICO TXT string problems; odtI = new ODTImporter(); // odtI.OpenDOCX((object)OpenDialog.FileName); odtI.OpenODT(OpenDialog.FileName); //odtI.OpenTXT(OpenDialog.FileName); problems = odtI.PutTag(); //Creo RTF CreaRTF(); File.WriteAllText("PQLOG.txt", problems); if (problems.Length > 0) { MessageBox.Show(problems); } else { MessageBox.Show("OK"); } } }
//guarda el archivo private void SaveFileBtn(object sender, EventArgs e) { string name = Environment.MachineName; //verifica mediante una variable bandera si el archivo ya se ha abrio if (Fs.Flag) { //Escribe en el archivo. Fs.WriteFile(TextContent.Text); } else { // Abrimos OpenDialog para indicar donde queremos // Guardar el archivo OpenDialog.InitialDirectory += name + "\\Desktop\\"; //Ponemos un nombre al archivo por Defecto OpenDialog.FileName = "Document.rtf"; //ponemos la verifiacacion de esxistencia del archivo como falsa OpenDialog.CheckFileExists = false; OpenDialog.Title = "Guardar como"; if (OpenDialog.ShowDialog() == DialogResult.OK) { // se establece la ruta de acceso Fs.Path = OpenDialog.FileName; NameFilePath.Text = Path.GetFileName(OpenDialog.FileName); Fs.WriteFile(TextContent.Text); } } }
private void SelectFile() { if (OpenDialog.ShowDialog() == DialogResult.OK) { txtFile.Text = OpenDialog.FileName; } }
private void OpenDialogue() { if (OpenDialog.ShowDialog() == DialogResult.OK) { Open(OpenDialog.FileName); } }
private void buttonImport_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { Password.Text = OpenDialog.FileName; this.DialogResult = DialogResult.Yes; } }
private void OpenButton_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { string fileName = OpenDialog.FileName; OpenFile(fileName); } }
private void ReadFileBtn_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { settings = (Settings)Savior.ReadFromFile(OpenDialog.FileName); this.GetSettings(); } }
private void DeployButton_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { SPSolution solution = SPFarm.Local.Solutions.Add(OpenDialog.FileName); solution.Deploy(DateTime.Now, true, _utility.GetAllWebApplications(), true); } }
private void ChooseXMLToolStripMenuItem_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog(this) != DialogResult.OK) { return; } XMLTextBox.Text = OpenDialog.FileName; }
/// <summary> /// Handles load button click. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuFileLoad_Click(object sender, MouseEventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { PhaseFileIO(OpenDialog.FileName, false); MessageBox.Show("File loaded."); } }
private void btnDiag_Click(object sender, EventArgs e) { if (cmbOpcion.Text.Substring(0, 1).ToString() == "1") { //SaveFileDialog saveFileDialog = new SaveFileDialog(); Object RutaDir = Convert.ToString(Environment.CurrentDirectory); SaveDialog.Filter = "ANJU (*.bak)|*.bak"; SaveDialog.Title = "Respaldos"; SaveDialog.ShowDialog(); if (SaveDialog.FileName != "") { try { string Extfile = (SaveDialog.FileName.Substring(SaveDialog.FileName.Length - 3, 3)); switch (Extfile.ToUpper()) { case "BAK": txtPhat.Text = SaveDialog.FileName.ToString(); btnRestaurar.Enabled = false; btnRespaldar.Enabled = true; break; } } catch (Exception Ex) { throw new Exception(Ex.Message, Ex.InnerException); } } } if (cmbOpcion.Text.Substring(0, 1).ToString() == "2") { //SaveFileDialog saveFileDialog = new SaveFileDialog(); Object RutaDir = Convert.ToString(Environment.CurrentDirectory); OpenDialog.Filter = "ANJU (*.bak)|*.bak"; OpenDialog.Title = "Respaldos"; OpenDialog.ShowDialog(); if (OpenDialog.FileName != "") { try { string Extfile = (OpenDialog.FileName.Substring(OpenDialog.FileName.Length - 3, 3)); switch (Extfile.ToUpper()) { case "BAK": txtPhat.Text = OpenDialog.FileName.ToString(); btnRespaldar.Enabled = false; btnRestaurar.Enabled = true; break; } } catch (Exception Ex) { throw new Exception(Ex.Message, Ex.InnerException); } } } }
private void buttonLoadFromXML_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { _sqlContext.MetadataContainer.ImportFromXML(OpenDialog.FileName); Modified = true; UpdateMetadataStats(); } }
void OpenOnClick(object objSrc, EventArgs args) { OpenDialog dlg = new OpenDialog(settings); if (dlg.ShowDialog() == DialogResult.OK) { Go(dlg.Url, true); } }
private void VersionPathEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (OpenDialog.ShowDialog() != DialogResult.OK) { return; } VersionPathEdit.EditValue = OpenDialog.FileName; }
private void btnUpPDF_Click(object sender, EventArgs e) { OpenDialog.Filter = "Portable Document Format (*.PDF)|*.PDF"; OpenDialog.FilterIndex = 1; OpenDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);; OpenDialog.Title = "Cargar Documento PDF"; OpenDialog.CheckFileExists = false; OpenDialog.Multiselect = false; DialogResult result = OpenDialog.ShowDialog(); if (result == DialogResult.OK) { TextEdit textEdit = new TextEdit(); textEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Regular; textEdit.Properties.MaxLength = 100; //textEdit.Properties.Mask.EditMask = "f0"; //textEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask. XtraInputBoxArgs args = new XtraInputBoxArgs(); // set required Input Box options args.Caption = "Ingrese el nombre del Archivo"; args.Prompt = "Descripción"; args.DefaultButtonIndex = 0; //args.Showing += Args_Showing; // initialize a DateEdit editor with custom settings TextEdit editor = new TextEdit(); args.Editor = editor; // a default DateEdit value args.DefaultResponse = "Archivo PDF"; // display an Input Box with the custom editor args.Editor = textEdit; var result2 = XtraInputBox.Show(args).ToString(); if (result2 != null) { txtNombreArchivoPDF.Text = result2; string ar = OpenDialog.FileName; FileStream fs = new FileStream(ar, FileMode.Open); //Creamos un array de bytes para almacenar los datos leídos por fs. Byte[] Archivo = new byte[fs.Length]; //Y guardamos los datos en el array data fs.Read(Archivo, 0, Convert.ToInt32(fs.Length)); CLS_Activos udp = new CLS_Activos(); udp.Id_Activo = vId_Activo; udp.Opcion = 1; udp.NombreArchivoPDF = txtNombreArchivoPDF.Text; udp.ArchivoPDF = Archivo; udp.MtdUpdateActivoArchivoPDF(); if (udp.Exito) { XtraMessageBox.Show("Se a agregado el PDF con Exito"); } else { XtraMessageBox.Show(udp.Mensaje); } } } }
/// <summary> /// Loads a config file, converts it into a byte array, and sends it to remote /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void loadPhaseToolStripMenuItem_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { SendCmd("load_phase!"); SendFile(OpenDialog.FileName); MessageBox.Show(RecieveMessage()); } }
private void NightSetImageToolStripMenuItem_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { night_wallpaper = OpenDialog.FileName; nightImageToolStripMenuItem.Text = night_wallpaper.Split('\\').Last(); SetSettings(); } }
private void btnAgregar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { OpenDialog.Filter = "Formato de imagen PNG (*.png)|*.png |Formato de imagen JPEG (*.jpg)|*.jpg|La extensión de imagen .gif (*.gif)|*.gif"; OpenDialog.FilterIndex = 1; OpenDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);; OpenDialog.Title = "Cargar Imagenes"; OpenDialog.CheckFileExists = false; OpenDialog.Multiselect = false; DialogResult result = OpenDialog.ShowDialog(); if (result == DialogResult.OK) { TextEdit textEdit = new TextEdit(); textEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Regular; textEdit.Properties.MaxLength = 100; //textEdit.Properties.Mask.EditMask = "f0"; //textEdit.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask. XtraInputBoxArgs args = new XtraInputBoxArgs(); // set required Input Box options args.Caption = "Ingrese la descripcion de la imagen"; args.Prompt = "Descripción"; args.DefaultButtonIndex = 0; //args.Showing += Args_Showing; // initialize a DateEdit editor with custom settings TextEdit editor = new TextEdit(); args.Editor = editor; // a default DateEdit value args.DefaultResponse = "Descripcion de la Imagen"; // display an Input Box with the custom editor args.Editor = textEdit; var result2 = XtraInputBox.Show(args).ToString(); if (result2 != null) { Descripction = result2; gc.Gallery.ItemImageLayout = ImageLayoutMode.ZoomInside; gc.Gallery.ImageSize = new Size(120, 90); gc.Gallery.ShowItemText = true; Serie++; Valor = Serie.ToString(); Image im1 = Image.FromFile(OpenDialog.FileName); byte[] arr = null; arr = ImageAArray(im1); group1.Items.Add(new GalleryItem(im1, Valor, Descripction)); CLS_Activos ins = new CLS_Activos(); ins.Id_Activo = vId_Activo; ins.SerieImagen = Serie; ins.Descripcion = Descripction; ins.Imagen = arr; ins.MtdInsertarActivoImagen(); if (!ins.Exito) { XtraMessageBox.Show(ins.Mensaje); } } } }
private void btnDialog_Click(object sender, EventArgs e) { OpenDialog.FileName = ""; OpenDialog.DefaultExt = ".exe"; OpenDialog.Filter = "Application (.exe)|*.exe"; if (OpenDialog.ShowDialog() == DialogResult.OK) { txtPath.Text = OpenDialog.FileName; } }
private void BrowserButton_Click(object sender, EventArgs e) { OpenDialog.FileName = string.Empty; OpenDialog.Filter = "*.xlsx|*.xlsx"; if (OpenDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { FileText.Text = OpenDialog.FileName; } }
private void button1_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { foreach (string f in OpenDialog.FileNames) { Process.Start(@"..\..\..\..\MegaLZ.exe", '"' + f + '"'); } } }
private void LoadGenomeButton_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog(this) != DialogResult.OK) { return; } DNA = new DNA(OpenDialog.FileName); UpdateDNAView(); UpdateGenomeEditor(); }
private void btnExaminar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (CargarPosicionColumnas()) { OpenDialog.Filter = "Formato de Excel XLSX (*.xlsx)|*.xlsx|Formato de Excel XLS (*.xls)|*.xls"; OpenDialog.FilterIndex = 1; OpenDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);; OpenDialog.Title = "Cargar Documento Excel"; OpenDialog.CheckFileExists = false; OpenDialog.Multiselect = false; DialogResult result = OpenDialog.ShowDialog(); if (result == DialogResult.OK) { txtRutaArchivo.Text = OpenDialog.FileName; var str = string.Empty; rCnt = Row_PSC_Inicio; try { rCnt = Row_PSC_Inicio; SLDocument s1 = new SLDocument(OpenDialog.FileName); int celdas = 0; while (!String.IsNullOrEmpty(s1.GetCellValueAsString(rCnt, 1))) { celdas++; rCnt++; } pgbProgreso.Properties.Maximum = celdas; rCnt = Row_PSC_Inicio; while (!String.IsNullOrEmpty(s1.GetCellValueAsString(rCnt, 1))) { pgbProgreso.Position = rCnt; Application.DoEvents(); string vFecha = s1.GetCellValueAsDateTime(rCnt, Col_PSC_Fecha).ToString(); string vHora = s1.GetCellValueAsString(rCnt, Col_PSC_Time).ToString(); string vTempOut = s1.GetCellValueAsString(rCnt, Col_PSC_TempOut); string vET = s1.GetCellValueAsString(rCnt, Col_PSC_ET); string vRain = s1.GetCellValueAsString(rCnt, Col_PSC_Rain); CreatNewRowArticulo(vFecha, vHora, vTempOut, vET, vRain); rCnt++; } pgbProgreso.Position = 0; } catch (Exception EX) { XtraMessageBox.Show(EX.Message); } } } else { XtraMessageBox.Show("No se pudo tener acceso a los parametros para las posiciones de Excel"); } }
private void DecryptButton_Click(object sender, EventArgs e) { if (OpenDialog.ShowDialog() == DialogResult.OK) { var textFileName = OpenDialog.FileName; var secureFile = new CryptFile(textFileName); secureFile.DecryptFile(); MessageBox.Show("File decrypted", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//Зчитування даних з інших файлів private void OpenFileTool_Click(object sender, EventArgs e) { ClearAll_Click(null, null); OpenDialog.Title = "Відкрити файл"; OpenDialog.Filter = "Файл TXT|*.txt|Файл RTF|*.rtf|Файл Excel|*.xls|Файл Word|*.doc|Всі файли|*.*"; OpenDialog.FileName = ""; if (OpenDialog.ShowDialog() == DialogResult.Cancel) { return; } FileStream fStream = new FileStream(OpenDialog.FileName, FileMode.Open); StreamReader streamReader = new StreamReader(fStream); try { string[] str = streamReader.ReadToEnd().Split('\n'); string[] str1; //Видалення символу повертання каретки '\r' for (int i = 0; i < str.Length; i++) { str[i] = str[i].Replace("\r", ""); } //Ділення рядку по пробілу для зчитування парметрів відрізку str1 = str[1].Split(' '); LeftBorder.Text = str1[2]; str1 = str[2].Split(' '); RightBorder.Text = str1[2]; str1 = str[3].Split(' '); AmountSections.Text = str1[2]; str1 = str[4].Split(' '); StepBreak.Text = str1[2]; //Зчитування початкових умов та самих рівнянь for (int i = 7; !(str[i] == ""); i++) { str1 = str[i].Split(' '); AddTextBox_Click(null, null); ConditionTBox[iter - 1].Text = str1[0]; EquationTBox[iter - 1].Text = str1[1]; } RungeKuttaMethod_Click(null, null); } catch (Exception) { MessageBox.Show("Виникла помилка під час відкриванні файлу!", "Помилка в ході програми", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void bimportIDML_Click(object sender, EventArgs e) { string idmlfile = @"c:\PQ\pqsetott2013\PQ SETT-OTT 2013 MODIFICATO.idml"; OpenDialog.Filter = "IDML Files|*.idml"; OpenDialog.Multiselect = false; OpenDialog.Title = "Seleziona il file IDML definitivo"; OpenDialog.FileName = ""; if (OpenDialog.ShowDialog() == DialogResult.OK) { idmlfile = OpenDialog.FileName; } string problems; PQI = new PQImporter(); PQImporter.ODTorIDML = true; PQI.OpenIDML(idmlfile); problems = PQI.PutTag(); CreaRTFIDML(); File.WriteAllText("PQLOG.txt", problems); if (problems.Length > 0) { MessageBox.Show("problems"); } else { MessageBox.Show("OK"); } //PQI = new PQImporter(); //PQI.Open(@"c:\Users\CasaEster\Documents\prova.rtf", true); //if (OpenDialog.ShowDialog() == DialogResult.OK) //{ // //CARICO RTF // PQI = new PQImporter(); // PQI.Open(OpenDialog.FileName,true); // problems = odtI.PutTag(); // //Creo RTF // CreaRTFIDML(); // File.WriteAllText("c:\\PQLOG.txt", problems); // if (problems.Length > 0) MessageBox.Show(problems); // else MessageBox.Show("OK"); //} }