End Google Ads 201810 - BS.net 01 -->
hi! im having problems with a code im working on a Windows Form Application
I will post the code I have so far:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Trabajo_de_Programacion1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string nombre;
int intentos;
intentos = 0;
nombre = textBox1.Text;
label8.Text = "Hola," + nombre + " !";
switch (comboBox1.SelectedIndex)
{
case 0:
{ intentos = 10; }
break;
case 1:
{ intentos = 8; }
break;
case 2:
{ intentos = 5; }
break;
case 3:
{ intentos = 3; }
break;
}
label9.Text = "Numero de intentos restantes: " + intentos;
Random randNum1 = new Random();
randNum1.Next();
label10.Text = "" + (randNum1.Next(4));
randNum1.Next();
label11.Text = "" + (randNum1.Next(4));
randNum1.Next();
label12.Text = "" + (randNum1.Next(4));
randNum1.Next();
label13.Text = "" + (randNum1.Next(4));
}
private void button2_Click(object sender, EventArgs e)
{
int intentosrestantes, intentos, ;
intentos = label9.Text; intentosrestantes = (intentos - 1);
label9.Text = "" + intentosrestantes;
}
}
}
The error I get is on the label9.Text and it says :Cannot implicitly convert type "string" to "int"
Thanks for the help!
مواقع النشر (المفضلة)