Лабораторная работа: Creating graphic editor
Scroll(g).Value = TakeRGB (TheColor, 0): Scroll (g + 1).Value = TakeRGB (TheColor, 1): Scroll (g + 2).Value = TakeRGB (TheColor, 2)
10 End Sub
Private Sub Command1_Click()
f$ = InputBox («Input the size of the eraser», «Drawer V1.0», EraserOptionText. Text)
f$ = RTrim$(LTrim$(f$))
If «» + f$ <> Str$(Val (f$)) Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
If Val (f$) <> Int (Val(f$)) Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
If Val (f$) > 500 Or Val (f$) < 100 Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
EraserOptionText. Text = f$
EraserSize = Val (f$)
Shape3. Width = Val (f$): Shape3. Height = Val (f$)
Shape1. Width = Val (f$): Shape1. Height = Val (f$)
End Sub
Private Sub Command2_Click()
f$ = InputBox («Input the border of the line or pencil», «Drawer V1.0», LineOptionText. Text)
f$ = RTrim$(LTrim$(f$))
If «» + f$ <> Str$(Val (f$)) Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
If Val (f$) <> Int (Val(f$)) Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
If Val (f$) > 10 Or Val (f$) < 1 Then MsgBox «Input error!», vbOKOnly, «Drawer V1.0»: Exit Sub
LineOptionText. Text = f$
PencilSize = Val (f$)
Line2. BorderWidth = Val (f$)
End Sub
Private Sub DialogBox_Click (Index As Integer)
Static coloring As Long
On Error GoTo 100
CommonDialog1. ShowColor
coloring = CommonDialog1. Color
Scroll (Index * 3).Value = TakeRGB (coloring, 0)