lمع تحيات العباس السوري
اولا ضع خمس مربعات نص
وتلات ازرار اوامر
وبعدين انقل الكود التالي
Option Explicit
Dim a, b, c, d, f, x1, x2 As Double
Dim X As String
Private Sub Command1_Click()
If Text1.Text = " " Then Command1.Enabled = False
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = b ^ 2 - 4 * a * c
If d = 0 Then
x1 = (-b) / (2 * a)
x2 = (-b) / (2 * a)
Text4.Text = x1
Text5.Text = x2
End If
(“If d < 0 Then MsgBox (” IT`S IMPOoOSSIPLE" + "
If d < 0 Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End If
If d > 0 Then
x1 = (-b + d ^ 0.5) / (2 * a)
x2 = -(b + d ^ 0.5) / (2 * a)
Text4.Text = x1
Text5.Text = x2
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub
Private Sub Form_Load()
Command1.Enabled = False
End Sub
Private Sub Text1_Change()
If Text1.Text = “” Then Command1.Enabled = False
End Sub
Private Sub Text2_Change()
If Text2.Text = “” Then Command1.Enabled = False Else
End Sub
Private Sub Text3_Change()
If Text3.Text = “” Then Command1.Enabled = False Else
Command1.Enabled = True
If Text3.Text = “” Then Command1.Enabled = False Else
End Sub
lمع تحيات العباس السوري
وانشالله بعجبكن
للاستفسار
al3bbas@maktoob.com