To write the code in C

• Double-click on frmDesigner to see the code view for the Windows form. Add the following code to create the selChangeLayoutToolbar event.

The following example shows what the code for the method looks like:

[Visual Basic] Private Sub selChangeLayoutToolbar()

cnt = Me.Designerl.Selection.Count If cnt = 0 Then

Me.setModes(toolbarModes.noControls) Elself ((cnt = 1) AndAlso ((Me.Designer1.Selection(0).GetType().BaseType.ToString() < ActiveReports.Section") AndAlso (Me.Designer1.Selection(0).GetType().BaseType.ToStr <> "System.Object"))) Then

Me.setModes(toolbarModes.singleControl)

Me.setModes(toolbarModes.twoControls) Elself (cnt > 2) Then

Me.setModes(toolbarModes.multiControls) End If

End Sub

private void selChangeLayoutToolbar() {

int cnt = this.designerl.Selection.Count; if(cnt==0)

this.setModes(toolbarModes.noControls);

lse if((cnt==1)&&((this.designer1.Selection[0].GetType().BaseType.ToString() !=

"DataDynamics.ActiveReports.Section")&&(this.designer1.Selection[0].GetTyp BaseType.ToString() != "System.Object")))

this.setModes(toolbarModes.singleControl);

this.setModes(toolbarModes.twoControls);

this.setModes(toolbarModes.multiControls);

0 0

Post a comment