Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:rhinocommonsamples:maximizeview [2015/09/14]
developer:rhinocommonsamples:maximizeview [2020/08/14] (current)
Line 1: Line 1:
 +===== Sample: Maximize a View =====
  
 +===== C# =====
 +<code c#>
 +public class MaximizeViewCommand : Command
 +{
 +
 +  public override string EnglishName { get { return "csMaximizeView"; } }
 +
 +  protected override Result RunCommand(RhinoDoc doc, RunMode mode)
 +  {
 +    var view = doc.Views.ActiveView;
 +    if (view != null)
 +      view.Maximized = true;
 +      
 +    return Result.Success;
 +  }
 +}
 +</code>
 +===== VB.NET =====
 +<code vb>
 +Public Class MaximizeViewCommand
 +  Inherits Command
 +
 +  Public Overrides ReadOnly Property EnglishName() As String
 +    Get
 +      Return "vbMaximizeView"
 +    End Get
 +  End Property
 +
 +  Protected Overrides Function RunCommand(doc As RhinoDoc, mode As RunMode) As Result
 +    Dim view As RhinoView = doc.Views.ActiveView
 +    
 +    If view IsNot Nothing Then
 +      view.Maximized = True
 +    End If
 +    
 +    Return Result.Success
 +  End Function
 +End Class
 +d Namespace
 +</code>
 +
 +{{tag>Developer rhinocommon}}