CS
cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
private void MostrarSiguiente()
{ //Funcion Random
int ListSelect = random.Next(1, 3);
//MessageBox.Show("Seleccionando aleatoriamente: " + ListSelect);
if (ListSelect == 1 && imagesACT.Count > 0)
{
MostrarImagenAleatoria();
}
else if (ListSelect == 2 && videosACT.Count > 0)
{
ReproducirVideoAleatorio();
}
}
private void MostrarImagenAleatoria()
{
if (imagesACT.Count == 0)
{
MessageBox.Show("No hay imagenes disponibles.");
return;
}
int indiceAleatorio = random.Next(imagesACT.Count);
Image imagenSeleccionada = imagesACT[indiceAleatorio];
MostrarImagen(imagenSeleccionada);
imagetimer.Tick -= ImageTimer_Tick;
imagetimer.Tick += ImageTimer_Tick;
MessageBox.Show("Mostrando imagen aleatoria con índice: " + indiceAleatorio);
imagetimer.Start();
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run