This event is fired before an item is moved, sized or deleted. You can use this event to control the end user's actions. For example, you can prevent the user from deleting the report's data control or moving a predefined set of controls that are part of a standard report template.
object_ValidateChange(control As Object, changeType As LayoutChangeTypes, Cancel As Boolean)
The ValidateChange event syntax has the following parts:
Part | Description |
---|---|
object | An expression evaluating to an object of type ARDesigner. |
control | Object |
changeType | LayoutChangeTypes |
Cancel | Boolean |
The settings for changeType are:
Setting | Description |
---|---|
ddLCControlMove | 0 - A control's position has changed. |
ddLCControlSize | 1 - A control's size has changed. |
ddLCControlDelete | 2 - A control is deleted. |
ddLCSectionSize | 3 - A section's size has changed. |
ddLCSectionDelete | 4 - A section is deleted. |
ddLCSectionMove | 5 - A section is moved. |
ddLCReportSize | 6 - The report's size is changed. |
ddLCControlAdd | 7 - A new control is added to the report. |
ddLCSectionsAdd | 8 - A new section is added to the report. |
Private Sub ARDesigner1_ValidateChange(ByVal control As Object, _
ByVal changeType As DDActiveReportsDesignerCtl.LayoutChangeTypes, _
Cancel As Boolean)
If changeType = ddLCControlDelete Then
If control.Name = "DataControl1" Then
MsgBox "You cannot delete the reports data source."
Cancel = True
End If
End If
End Sub