Private Sub butObjColor_Click()
' задать цвет объекта
Dim SqlStr As String
Dim lColor As Long
On Error GoTo Err_Debug
Me.butObjColor.SpecialEffect = 2
lColor = ShowColorDialog(Me.hWnd, True, IIf(TvObject.LastNode.ForeColor > 0, 0, 255))
If lColor = -1 Then
GoTo Exit_Here
End If
TvObject.LastNode.ForeColor = lColor
SqlStr = "UPDATE STRATEGY.OPER_OBJECT_TREEVIEW "
SqlStr = SqlStr + " SET OBJ_COLOR = " & lColor
SqlStr = SqlStr + " WHERE (ID_OBJECT = '" & TvObject.LastNodeKey & "')"
Result = AdoServerRecordset(varText:=SqlStr, varConnect:=modConnect).Execute
Exit_Here:
Me.butObjColor.SpecialEffect = 1
Exit Sub
Err_Debug:
MsgBox Err.Description
Resume Exit_Here
End Sub
|