6 pièce(s) jointe(s)
VB 2010: Interaction entre les projets.Problème avec les images
bonjour à tous. J'ai besoin de votre aide. J'étale mon problème:
J'ai crée:
1- Projet nommé "Multiplication":
Pièce jointe 162673
son code:
Code:
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 |
2- Projet nommé "Division":
Pièce jointe 162674
son code:
Code:
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 |
3- Projet nommé "Calcul":
Pièce jointe 162675
son code:
Code:
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 |
Jusque ici tout va bien. J'ai crée un autre projet nommé "PELE":
Pièce jointe 162677
son code:
Code:
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 |
tout va bien jusqu'ici, exemple:
Pièce jointe 162678
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:
Code:
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 |
Voilà le message du compilateur:
Pièce jointe 162682
Merci à vous