number_1 = 0
number_2 = 2
GraphicsWindow.Width = 500
GraphicsWindow.Height = 300
GraphicsWindow.FontSize = 11
GraphicsWindow.Title = "Работа с двумя текстовыми полями"
GraphicsWindow.BrushColor = "Blue"
NewBtnSet = Controls.AddButton("сложить поля", 0,150)
Controls.SetSize(NewBtnSet, 300,50)
Controls.ButtonClicked = OnButtonClick
Controls.TextTyped = OnTextTyped
NewEdit_1 = Controls.AddTextBox(0,0)
NewEdit_2 = Controls.AddTextBox(0,50)
Sub OnButtonClick
if Controls.LastClickedButton = NewBtnSet Then
result = number_1 + number_2
GraphicsWindow.ShowMessage(result,"Результат сложения")
EndIf
EndSub
Sub OnTextTyped
edit = Controls.LastTypedTextBox
If edit = NewEdit_1 then
number_1 = Controls.GetTextBoxText(edit)
Else
number_2 = Controls.GetTextBoxText(edit)
EndIf
EndSub
|