Soyez le premier à donner votre avis sur cette source.
Vue 2 093 fois - Téléchargée 178 fois
Dim grd As Integer Dim A As Variant Dim B As Variant Dim C As Variant Private Sub cmdGrandir_Click() If grd = 0 Then If cmdGrandir.Caption = ">>" Then Form1.Width = 8685 cmdGrandir.Caption = "<<" GoTo err End If If cmdGrandir.Caption = "<<" Then Form1.Width = 5265 cmdGrandir.Caption = ">>" GoTo err End If End If If grd = 1 Then If cmdGrandir.Caption = ">>" Then Form1.Width = 10620 cmdGrandir.Caption = "<<" GoTo err End If If cmdGrandir.Caption = "<<" Then Form1.Width = 5265 cmdGrandir.Caption = ">>" GoTo err End If End If err: End Sub Private Sub Command1_Click() 'Rendre invisible ce label labB0.Visible = False 'Verification que tout les champs soient remplis If valA.Text = "" Then MsgBox "Veuillez renseigner tous les champs !", vbCritical, " ..:: WARNING ::.." GoTo err End If cmdGrandir.Caption = "<<" If valB.Text = "" Then MsgBox "Veuillez renseigner tous les champs !", vbCritical, " ..:: WARNING ::.." GoTo err End If If valC.Text = "" Then MsgBox "Veuillez renseigner tous les champs !", vbCritical, " ..:: WARNING ::.." GoTo err End If Denome = 2 * A 'Calcul de Delta delta = (B * B) - (4 * A * C) 'Calcul des solutions possible selon le signe de delta et s'il est nul 'Determination du nombre de solution et affichage ds solutions s'il y en a If delta < 0 Then MsgBox "L'équation n'admet pas de solution réelle car delta est negatif " & vbCrLf & " Delta = " & delta, vbInformation, " ..:: WARNING : Pas de solution réelle ::.." cmdGrandir.Enabled = False End If If delta = 0 Then grd = 0 cmdGrandir.Enabled = True X = (-B) / (2 * A) labNbrSolution.Caption = "L'équation admet une solution qui est :" labdelta.Caption = "Delta = " & delta labB0.Caption = "- (" & B & ")" lab2A.Caption = Denome labX1.Caption = "X = " & X cmdGrandir.Caption = "<<" Label11.Caption = "X" Line3.X2 = 8520 Line5.X2 = 8520 Line8.X2 = 8520 Line12.X1 = 8520 Line15.X1 = 7080 Line15.X2 = 8040 labDelta1(0).Visible = False labB0.Visible = True labB1.Visible = False Line13.Visible = False Line14.Visible = False Line10.Visible = False '8685 Form1.Width = 8685 End If If delta > 0 Then grd = 1 cmdGrandir.Enabled = True 'Redimensionnement et visibilité de certains composants Line3.X2 = 10440 Line5.X2 = 10440 Line8.X2 = 10440 Line12.X1 = 10440 Line15.X1 = 6720 Line15.X2 = 8400 labDelta1(0).Visible = True labB0.Visible = False labB1.Visible = True Line13.Visible = True Line14.Visible = True Line10.Visible = True labB1.Caption = "- (" & B & ")" & " -" labDelta1(0).Caption = delta lab2A.Caption = Denome labB2.Caption = "- (" & B & ")" & " +" labDelta1(1).Caption = delta lab2Ab.Caption = Denome X1 = (-B - Sqr(delta)) / (2 * A) X2 = (-B + Sqr(delta)) / (2 * A) labNbrSolution.Caption = "L'équation admet deux solutions qui sont :" labdelta.Caption = "Delta = " & delta labX1.Caption = X1 labX2.Caption = X2 Form1.Width = 10620 End If err: End Sub Private Sub Command2_Click() End Sub Private Sub Form_Load() End Sub Private Sub valA_Change() labA.AutoSize = True labA.Caption = valA.Text & " X²" If valA.Text = "" Then labA.Caption = "" If valA <> "" Then A = valA.Text End Sub Private Sub valB_Change() labB.AutoSize = True If valB.Text = "" Then labB.Caption = "" If valB.Text <> "" Then B = valB.Text If B > 0 Then labB.Caption = "+" & B & " X" If B < 0 Then labB.Caption = B & " X" If B = 0 Then labB.Caption = "+" & B End Sub Private Sub valC_Change() labC.AutoSize = True labC.Caption = valC.Text & " = 0 " If valC.Text = "" Then labC.Caption = "" If valC.Text <> "" Then C = valC.Text If C > 0 Then labC.Caption = "+" & C & " = 0" If C < 0 Then labC.Caption = C & " = 0" If C = 0 Then labC.Caption = "+" & C & " = 0" End Sub
20 mars 2002 à 18:54
20 mars 2002 à 14:29
19 mars 2002 à 14:21
18 mars 2002 à 19:25
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.