bonjour à tous. J'ai besoin de votre aide. J'étale mon problème:
J'ai crée:
1- Projet nommé "Multiplication":
son code:
2- Projet nommé "Division":
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 Public Class Form_Multiplication Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If IsNumeric(TextBox1.Text) And IsNumeric(TextBox2.Text) Then Me.LBL_Resultat.Text = TextBox1.Text * TextBox2.Text End If End Sub End Class
son code:
3- Projet nommé "Calcul":
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 Public Class Form_Division Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If IsNumeric(TextBox1.Text) And IsNumeric(TextBox2.Text) Then Me.LBL_Resultat.Text = TextBox1.Text / TextBox2.Text End If End Sub End Class
son code:
Jusque ici tout va bien. J'ai crée un autre projet nommé "PELE":
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 Public Class Form_Mere Private Sub BT_Multiplication_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT_Multiplication.Click Dim f As New Form_Multiplication f.Show() End Sub Private Sub BT_Division_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT_Division.Click Dim f As New Form_Division f.Show() End Sub End Class
son code:
tout va bien jusqu'ici, exemple:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 Public Class Form_Pele Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If RB_Allmagne.Checked Then Me.Panel1.BackgroundImage = PELE.My.Resources.Ozil ElseIf RB_Argentine.Checked Then Me.Panel1.BackgroundImage = PELE.My.Resources.messi Else Me.Panel1.BackgroundImage = PELE.My.Resources.pele End If End Sub End Class
Le problème c'est quand je veux intégrer le projet "PELE" au projet "Calcul". J'ai ajouté un bouton "BT_PELE" (en plus de "Division et "Multiplication déja intégrés"), ça ne marche pas avec le code suivant:
Voilà le message du compilateur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 Public Class Form_Mere Private Sub BT_Multiplication_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT_Multiplication.Click Dim f As New Form_Multiplication f.Show() End Sub Private Sub BT_Division_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT_Division.Click Dim f As New Form_Division f.Show() End Sub Private Sub BT_PELE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT_PELE.Click Dim f As New Form_Pele f.Show() End Sub End Class
Merci à vous
Partager