Hengrip
Hengrip
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
No description
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
Thanks man really appreciate it
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
Ayyyy that totally worked!!!
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
Lemme try it
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
Makes sense
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
In the delete function or the call function?
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
How can I integrate dispose correctly in the code? I'm really sorry C# isn't my strength
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
This is the part that "calls" the image
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
private void btnSeleccionarCarpeta_Click(object sender, EventArgs e){
FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == DialogResult.OK) { rutasImages.Clear(); pcbImagen.Image = null; btnAdelante.Visible = false; btnAtras.Visible = false; rutaCarpeta = fbd.SelectedPath; lblCarpeta.Text = rutaCarpeta; DirectoryInfo di = new DirectoryInfo(@rutaCarpeta); foreach (FileInfo fi in di.GetFiles()) { if (fi.Extension == formato && fi.CreationTime <= fecha) { string fiRuta = @rutaCarpeta + @"" + @fi.Name; rutasImages.Add(@fiRuta); } } di = null; if(rutasImages.Count > 0) { lblElementos.Text = rutasImages.Count.ToString() + " Elementos Antiguos"; btnAdelante.Visible = true; btnAtras.Visible = false; indicePcb = 0; pcbImagen.Image = Image.FromFile(rutasImages[0]); } else { MessageBox.Show("No existen elementos que coincidan con los parametros de la app", "ADVERTENCIA"); lblElementos.Text = "0 Elementos Antiguos"; pcbImagen.Image = null; btnAdelante.Visible = false; btnAtras.Visible = false; } } }
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
When you press a button
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
This is the part that deletes the photo
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
private void btnEliminar_Click(object sender, EventArgs e) { if(rutaCarpeta != String.Empty) { DialogResult mensaje = MessageBox.Show("¿Esta seguro de eliminar los " + rutasImages.Count.ToString() + " archivos? ", "ADVERTENCIA", MessageBoxButtons.OKCancel); if (mensaje == DialogResult.OK) { foreach (var rutaImagen in rutasImages) { Dispose(); File.Delete(rutaImagen); } MessageBox.Show(rutasImages.Count.ToString() + " elementos eliminados", "ADVERTENCIA"); rutasImages.Clear(); } } else { MessageBox.Show("No existen imagenes para eliminar...", "ADVERTENCIA"); } }
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
Definition my bad
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
"does not contain a definition for dispose"
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
Let me see
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
I don't quite remember the especific error
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
Oh that's the original without dispose as it threw me an error saying there wan't a name for it or smt like that
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
This is it
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
Dispose throws another error telling me there's no name for that or smt like that
40 replies
CC#
Created by Hengrip on 11/13/2023 in #help
Can't delete image cuz my own program is using it??
Here's the full thing if you wish to check it but I know some people don't like opening code files so I just put the images above for refrence
40 replies