GrapeCity MultiRow Windows Forms Documentation
HorizontalResize Method (Cell)
Example 


Resizes the cell by the specified number of pixels in the horizontal direction. If offset is larger than 0, the cell's right border moves to the right and makes the cell larger than before. If offset is smaller than 0, the cell's right border moves to the left and makes the cell smaller than before.
Resizes the cell programmatically in the horizontal direction.
Syntax
Public Sub HorizontalResize( _
   ByVal offset As Integer _
) 
Dim instance As Cell
Dim offset As Integer
 
instance.HorizontalResize(offset)
public void HorizontalResize( 
   int offset
)

Parameters

offset
Resizes the cell by the specified number of pixels in the horizontal direction. If offset is larger than 0, the cell's right border moves to the right and makes the cell larger than before. If offset is smaller than 0, the cell's right border moves to the left 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
VerticalResize Method

 

 


Copyright © GrapeCity, inc. All rights reserved.