GrapeCity MultiRow Windows Forms Documentation
VerticalResize Method (Cell)
Example 


Resizes the cell a specified number of pixels in the vertical direction. If the cell is not in the ColumnFooterSection and if offset is larger than 0, the cell's bottom border moves down and makes the cell larger than before. If offset is smaller than 0, the cell's bottom border moves up and makes the cell smaller than before. If the cell is in the ColumnFooterSection and if offset is larger than 0, the cell's top border moves up and makes the cell larger than before. If offset is smaller than 0, the cell's top broder moves down and makes the cell smaller than before.
Resizes the cell programmatically in the vertical direction.
Syntax
Public Sub VerticalResize( _
   ByVal offset As Integer _
) 
Dim instance As Cell
Dim offset As Integer
 
instance.VerticalResize(offset)
public void VerticalResize( 
   int offset
)

Parameters

offset
Resizes the cell a specified number of pixels in the vertical direction. If the cell is not in the ColumnFooterSection and if offset is larger than 0, the cell's bottom border moves down and makes the cell larger than before. If offset is smaller than 0, the cell's bottom border moves up and makes the cell smaller than before. If the cell is in the ColumnFooterSection and if offset is larger than 0, the cell's top border moves up and makes the cell larger than before. If offset is smaller than 0, the cell's top broder moves down and makes the cell smaller than before.
Exceptions
ExceptionDescription
System.InvalidOperationException

Executes this method when the cell's owner Template is not set to GcMultiRow.

-or-

The Width or Height is zero.

-or-

This cell is beyond the boundary of the parent Section.

Remarks
This method provides the capability to resize the cell programmatically.
Example
The following code example shows how to use this method to resize a cell with code at run time. This code example is part of a larger example provided for the GcMultiRow.AllowUserToResize class.
void changeFristColumnWidth_Click(object sender, EventArgs e)
        {
            Cell cell = this.gcMultiRow1.ColumnHeaders[0][0];

            // Cell's width decreases by 5 pixels.
            cell.HorizontalResize(-5);
        }

        void changeFristRowWidth_Click(object sender, EventArgs e)
        {
           Cell cell = this.gcMultiRow1.Rows[0][0];

           // Cell's height decreases by 5 pixels.
           cell.VerticalResize(-5);
        }
Private Sub changeFristColumnWidth_Click(ByVal sender As Object, ByVal e As EventArgs) Handles 
changeFristColumnWidth.Click
        Dim cell As Cell = Me.gcMultiRow1.ColumnHeaders(0)(0)

        ' Cell's width decreases by 5 pixels.
        cell.HorizontalResize(-5)
    End Sub

    Private Sub changeFristRowWidth_Click(ByVal sender As Object, ByVal e As EventArgs) Handles 
changeFristRowWidth.Click
        Dim cell As Cell = Me.gcMultiRow1.Rows(0)(0)

        ' Cell's height decreases by 5 pixels.
        cell.VerticalResize(-5)
    End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Cell Class
Cell Members
HorizontalResize Method

 

 


Copyright © GrapeCity, inc. All rights reserved.