Comment afficher la réponse d'un calcule sur Windows Forms svp ?

batom - Modifié le 29 juin 2017 à 15:47
Whismeril Messages postés 19024 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 18 avril 2024 - 29 juin 2017 à 15:34
Bonjour, je voudrais savoir comment afficher la réponse d'une calcule sur Windows Forms sil vous plat je ces que sur Visual studio Console application8 c'est Console.WriteLine(); mai sur WindowsForms je ne ces pas :( voici mon programme Windows Forms

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;



namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        private int euros;

        

        public Form1()
        {
            InitializeComponent();

            
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        public void textBox1_TextChanged(object sender, EventArgs e)
        {
            string saisie = textBox1.Text;
            // double euros = Convert.ToDouble(saisie);
            

        }

        public void label2_Click(object sender, EventArgs e)
            

        
        {

            


        }

        public void button2_Click(object sender, EventArgs e)
        {
            double euro = 6.55;
            
           double resultat = euros * euro;

            string AfficheResultat = Convert.ToString(resultat);

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        public void textBox2_TextChanged(object sender, EventArgs e)
        {
            
        }
    }
}


EDIT : Ajout des balises de code (la coloration syntaxique).

Explications disponibles ici :ICI

Merci d'y penser dans tes prochains messages.
Jordane45

1 réponse

Whismeril Messages postés 19024 Date d'inscription mardi 11 mars 2003 Statut Contributeur Dernière intervention 18 avril 2024 656
29 juin 2017 à 15:34
Bonjour

tu peux utiliser un TextBox ou un Label, regarde leur propriété Text
0
Rejoignez-nous