Курсовая работа: Проект программного модуля для нахождения корня уравнения
ActiveChart.HasDataTable = False
ActiveChart.Export Filename:=CurDir + "\Grafic_func.gif", FilterName:="GIF"
ActiveSheet.ChartObjects.Delete
Worksheets(1).UsedRange.Clear
Image1.Picture = LoadPicture(CurDir + "\Grafic_func.gif") 'загружаем в Image1 файл с графиком
Image1.Visible = True
CommandButton5.Enabled = False
CommandButton4.Enabled = True
End Sub
Public Function f(x As Double) As Double 'нахождение значения функции
f = x ^ 3 - x - 0.3
End Function
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) 'Проверка ввода
If KeyAscii > 26 Then
If InStr(number, Chr(KeyAscii)) = 0 Or (InStr(TextBox1.Text, ",") > 0 And Chr(KeyAscii) = ",") Or (TextBox1.SelStart > 0 And InStr(sign, Chr(KeyAscii)) > 0) Then
KeyAscii = 0
End If
End If
End Sub
Private Sub TextBox2_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) 'Проверка ввода
If KeyAscii > 26 Then
If InStr(number, Chr(KeyAscii)) = 0 Or (InStr(TextBox2.Text, ",") > 0 And Chr(KeyAscii) = ",") Or (TextBox2.SelStart > 0 And InStr(sign, Chr(KeyAscii)) > 0) Then
KeyAscii = 0
End If
End If
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) 'Закрытие формы
Select Case MsgBox("Закрыть окно?", vbYesNo + vbQuestion, "Завершение работы")
Case vbYes