3
I can’t convert my text TextBox in one piece.
namespace Pag98_Exe1
{
    public partial class frmveiculos : Form
    {
        public frmveiculos()
        {
            InitializeComponent();
        }
        Veiculos veiculos = new Veiculos(); //Declarando a classe veiculos
        private void btnenviar_Click(object sender, EventArgs e)
        {
            if(mskTxtplaca.Text != "" && cbxmarca.Text != "" && txtanofabricacao.Text != "")
            {
                veiculos.Placa = mskTxtplaca.Text; //Atribuindo o valor de Placa ao texto do TextBox
                veiculos.Marca = cbxmarca.Text;
                veiculos.AnoFabricacao(int.Parse(txtanofabricacao.Text)); //Passando o valor do TextBox para inteiro e atribuindo ao TextBox
            }
        }
    }
}
						
What’s the matter?
– Maniero
@bigown Gravity Code Description Project File Line Deletion State Error CS0029 Cannot implicitly convert type "string" to "int" Pag98_exe1 C: Users home Desktop Jobs COTEMIG Pag98_exe1 Pag98_exe1 28 Active
– Caio Vieira
@bigown Error line is 3rd within the if condition
– Caio Vieira
Already tried Convert.toInt32() ?
– Fernando Medeiros