See Also

IWorksheetWindowInfo Members  | SpreadsheetGear Namespace  | WindowInfo Property  | IWorkbookWindowInfo Interface

Requirements

Namespace: SpreadsheetGear

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: SpreadsheetGear (in SpreadsheetGear.dll)

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Requirements Languages SpreadsheetGear The Performance Spreadsheet Component Company 

IWorksheetWindowInfo Interface

SpreadsheetGear Namespace : IWorksheetWindowInfo Interface

Represents worksheet specific window information.

For a list of all members of this type, see IWorksheetWindowInfo members.

Syntax

[Visual Basic]
Public Interface IWorksheetWindowInfo
[C#]
public interface IWorksheetWindowInfo
[C++]
public __gc __interface IWorksheetWindowInfo
[C++/CLI]
public interface class IWorksheetWindowInfo

Example

[C#] 

// Demonstrates creating a workbook with frozen panes 
// using IWindowInfo.FreezePanes. 
internal static void FreezePanes() 

    // Create a workbook. 
    SpreadsheetGear.IWorkbook workbook = SpreadsheetGear.Factory.GetWorkbook(); 
    SpreadsheetGear.IWorksheet worksheet = workbook.Worksheets[0]; 
    worksheet.Name = "Freeze Panes"; 
 
    // Split after column "C" (ScrollColumn is zero based). 
    worksheet.WindowInfo.ScrollColumn = 2; 
    worksheet.WindowInfo.SplitColumns = 1; 
 
    // Split after row 2 (ScrollRow is zero based). 
    worksheet.WindowInfo.ScrollRow = 1; 
    worksheet.WindowInfo.SplitRows = 1; 
 
    // Freeze the panes. 
    worksheet.WindowInfo.FreezePanes = true; 
 
    // Select the first non-frozen cell. 
    SpreadsheetGear.IRange d3 = worksheet.Cells["D3"]; 
    d3.Select(); 
 
    // Enter some data in the frozen rows/cols. 
    worksheet.Cells["C2"].Value = "Worksheet Title"; 
    worksheet.Cells["D2"].Value = "Column Title"; 
    worksheet.Cells["C3"].Value = "Row Title"; 
 
    // Enter some data in D3, format the cell, and unlock the cell  
    // so it can bew edited after setting worksheet.ProtectContents to true. 
    d3.Value = "Edit Me"; 
    SpreadsheetGear.IFont font = d3.Font; 
    font.Name = "Tahoma"; 
    font.Size = 16.0; 
    font.Color = System.Drawing.Color.Blue; 
    d3.Locked = false; 
 
    // Autofit the columns. 
    worksheet.UsedRange.Columns.AutoFit(); 
 
    // Auto size the columns. 
    // Protect locked ce4lls. 
    worksheet.ProtectContents = true; 
 
    // Save the workbook. 
    workbook.SaveAs(@"c:\FreezePanes.xls", SpreadsheetGear.FileFormat.XLS97); 
}

[Visual Basic] 

' Demonstrates creating a workbook with frozen panes
' using IWindowInfo.FreezePanes.
Friend Shared Sub FreezePanes()
    ' Create a workbook.
    Dim workbook As SpreadsheetGear.IWorkbook = SpreadsheetGear.Factory.GetWorkbook()
    Dim worksheet As SpreadsheetGear.IWorksheet = workbook.Worksheets(0)
    worksheet.Name = "Freeze Panes"

    ' Split after column "C" (ScrollColumn is zero based).
    worksheet.WindowInfo.ScrollColumn = 2
    worksheet.WindowInfo.SplitColumns = 1

    ' Split after row 2 (ScrollRow is zero based).
    worksheet.WindowInfo.ScrollRow = 1
    worksheet.WindowInfo.SplitRows = 1

    ' Freeze the panes.
    worksheet.WindowInfo.FreezePanes = True

    ' Select the first non-frozen cell.
    Dim d3 As SpreadsheetGear.IRange = worksheet.Cells("D3")
    d3.Select()

    ' Enter some data in the frozen rows/cols.
    worksheet.Cells("C2").Value = "Worksheet Title"
    worksheet.Cells("D2").Value = "Column Title"
    worksheet.Cells("C3").Value = "Row Title"

    ' Enter some data in D3, format the cell, and unlock the cell
    ' so it can bew edited after setting worksheet.ProtectContents to true.
    d3.Value = "Edit Me"
    Dim font As SpreadsheetGear.IFont = d3.Font
    font.Name = "Tahoma"
    font.Size = 16.0
    font.Color = System.Drawing.Color.Blue
    d3.Locked = False

    ' Autofit the columns.
    worksheet.UsedRange.Columns.AutoFit()

    ' Auto size the columns.
    ' Protect locked ce4lls.
    worksheet.ProtectContents = True

    ' Save the workbook.
    workbook.SaveAs("c:\freezepanevb.xls", SpreadsheetGear.FileFormat.XLS97)
End Sub 'FreezePanes '

Requirements

Namespace: SpreadsheetGear

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: SpreadsheetGear (in SpreadsheetGear.dll)

See Also

IWorksheetWindowInfo Members  | SpreadsheetGear Namespace  | WindowInfo Property  | IWorkbookWindowInfo Interface

 

 


See our live Excel Reporting, Excel Charting, Excel to DataGrid and Excel Calculation Samples.

Copyright © 2003-2007 SpreadsheetGear LLC. All Rights Reserved.

SpreadsheetGear and Spreadsheet Gear are trademarks of SpreadsheetGear LLC.