# GrapeCity.ActiveReports.Design.Designer.ActiveTab

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_ActiveReports_Design_Designer_ActiveTab_" data-uid="GrapeCity.ActiveReports.Design.Designer.ActiveTab*">ActiveTab Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_ActiveReports_Design_Designer_ActiveTab_" data-uid="GrapeCity.ActiveReports.Design.Designer.ActiveTab*"></a>
<h4 id="GrapeCity_ActiveReports_Design_Designer_ActiveTab" data-uid="GrapeCity.ActiveReports.Design.Designer.ActiveTab">ActiveTab</h4>
<div class="markdown level1 summary"><p>Gets a value representing the currently selected tab in the designer interface.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Browsable(false)]
public DesignerTab ActiveTab { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.ActiveReports.Design.DesignerTab.html">DesignerTab</a></td>
      <td><p>The <a class="xref" href="GrapeCity.ActiveReports.Design.DesignerTab.html">DesignerTab</a> representing the active tab in the designer. This property provides access to the tab currently being interacted with by the user,
allowing for context-specific operations based on the selected tab.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Design_Designer_ActiveTab_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This property is particularly useful for determining the context within which the designer is operating, such as whether the user is focusing on design,
preview, or Script. Accessing this property can help in tailoring the UI and functionality to better suit the needs of the current designer state.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Design_Designer_ActiveTab_examples">Examples</h5>
<p>Utilize the ActiveTabChanged event to respond to switches between the Script, Design, and Preview tabs. The ActiveTab property allows you to determine
the currently active tab.</p>
<pre><code class="lang-csharp">public partial class Form1 : Form
{
	public Form1()
	{
		InitializeComponent();
		designer = new Designer() { Dock = DockStyle.Fill };
		designer.ActiveTabChanged += (sender, args) =&gt; {
			//Get the currently editing report name.
			var reportName = designer.Report switch
			{
				PageReport pageReport =&gt; pageReport.Report.Name,
				SectionReport sectionReport =&gt; sectionReport.Name,
				_ =&gt; "Report"
			};
			//Set the form title to reflect the current designer state
			this.Text = designer.ActiveTab switch
			{
				DesignerTab.Script =&gt; $"{reportName} - Script",
				DesignerTab.Preview =&gt; $"{reportName} - Preview",
				_ =&gt; $"{reportName} - Edit"
			};
		};
		Controls.Add(designer);
	}
}</code></pre>

</div>
