v9.0 (2011)
// get accessor Object rtn = View.Rectangle; |
' ' This example demonstrates how to use the View.Rectangle property ' set oView = Desktop.ActiveLayout.CreateView( "Explorer", "MyExplorer" ) oView.Move 100, 200 oView.Resize 500, 600 rect = oView.Rectangle LogMessage( "Left = " & rect(0) ) LogMessage( "Top = " & rect(1) ) LogMessage( "Width = " & rect(2) - rect(0) ) LogMessage( "Height = " & rect(3) - rect(1) ) ' Expected result: ' INFO : Left = 100 ' INFO : Top = 200 ' INFO : Width = 500 ' INFO : Height = 600 |
// // This example demonstrates how to use the View.Rectangle property // var oView = Desktop.ActiveLayout.CreateView( "Explorer", "MyExplorer" ); oView.Move( 100, 200 ); oView.Resize( 500, 600 ); var vba = new VBArray( oView.Rectangle ); var rect = vba.toArray(); LogMessage( "Left = " + rect[0] ); LogMessage( "Top = " + rect[1] ); LogMessage( "Width = " + (rect[2] - rect[0]) ); LogMessage( "Height = " + (rect[3] - rect[1]) ); // Expected result: // INFO : Left = 100 // INFO : Top = 200 // INFO : Width = 500 // INFO : Height = 600 |
# # This example demonstrates how to use the View.Rectangle property # oView = Application.Desktop.ActiveLayout.CreateView( "Explorer", "MyExplorer" ) oView.Move( 100, 200 ) oView.Resize( 500, 600 ) (left, top, right, bottom) = oView.Rectangle Application.LogMessage( "Left = " + str(left) ) Application.LogMessage( "Top = " + str(top) ) Application.LogMessage( "Width = " + str(right - left) ) Application.LogMessage( "Height = " + str(bottom - top) ) # Expected result: # INFO : Left = 100 # INFO : Top = 200 # INFO : Width = 500 # INFO : Height = 600 |