IWxView.ScrollToShape

Syntax

ScrollToShape(Shape: IWxShape);

ScrollToShape(Shape: Prognoz.Platform.Interop.Andy.IWxShape);

Parameters

Shape. Workspace shape.

Description

The ScrollToShape method centers the workspace image respectively to the defined shape.

Example

Executing the example requires the object of the workspacecontaining three shapes. Create a form, add the Button1 button to it, the WorkspaceBox component named WorkspaceBox1, the UiWorkspaceObject component named UiWorkspaceObject1, define the workspace as an object of the UiWorkspaceObject1 component, the UiWorkspaceObject1 component as the source of the WorkspaceBox1 component, and set the True value for the Active property of the UiWorkspaceObject1 component.

Add links to the Andy, Metabase, Workspace system assemblies.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
  WorkspaceBox1.View.ScrollToShape(WorkspaceBox1.View.Workspace.Shapes.Item(3));
End Sub Button1OnClick;

Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Workspace;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Begin
  WorkspaceBoxNet1.View.ScrollToShape(WorkspaceBoxNet1.View.Workspace.Shapes.Item[
3]);
End Sub;

By clicking the Button1 button the image of the workspace is centered relatively to the shape with the 3 index.

See also:

IWxView