GrapeCity MultiRow Windows Forms Documentation
ResizeTipTextNeeded Event
Example 


Occurs when the user resizes a cell and the cell gets the resize tip text.
Syntax
<SRDescriptionAttribute("Occurs when the ShowResizeTip property of the GcMultiRow control is true and the user performs the resize operation. ")>
<SRCategoryAttribute("Behavior")>
Public Event ResizeTipTextNeeded As EventHandler(Of ResizeTipTextNeededEventArgs)
Dim instance As GcMultiRow
Dim handler As EventHandler(Of ResizeTipTextNeededEventArgs)
 
AddHandler instance.ResizeTipTextNeeded, handler
[SRDescription("Occurs when the ShowResizeTip property of the GcMultiRow control is true and the user performs the resize operation. ")]
[SRCategory("Behavior")]
public event EventHandler<ResizeTipTextNeededEventArgs> ResizeTipTextNeeded
Event Data

The event handler receives an argument of type ResizeTipTextNeededEventArgs containing data related to this event. The following ResizeTipTextNeededEventArgs properties provide information specific to this event.

PropertyDescription
CellIndexGets the cell index in its parent Section. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs)
CellNameGets the cell name. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs)
DirectionGets a value that indicates the resize direction.  
NewValueGets the width or height value of the header cell in the current resize state. The unit is in pixels.  
OldValueGets the width or height of the cell before resizing. The unit is in pixels.  
ResizeTipTextGets or sets the displayed text in the resize tip.  
RowIndexGets the index of the owner Row that the event occurs for. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs)
ScopeGets the area of the cell that the event occurs for. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs)
SectionIndexGets the index of the owner Section that the event occurs for. (Inherited from GrapeCity.Win.MultiRow.CellEventArgs)
Remarks
A tip is displayed when you resize the Cell. You can customize the tip text by handling this event.
Example
The following code example shows how to customize the resize tip. This code example is part of a larger example provided for the AllowUserToResize class.
private void Form1_Load(object sender, EventArgs e)
        {
            // Use AllowUserToResize property to disable/enable MultiRow control's UIResize.
            this.gcMultiRow1.AllowUserToResize = true;

            // Show resize tip when UI resize.
            this.gcMultiRow1.ShowResizeTip = ResizeMode.Both;

            // Customize resize tip.
            this.gcMultiRow1.ResizeTipTextNeeded += new EventHandler<ResizeTipTextNeededEventArgs>(gcMultiRow1_ResizeTipTextNeeded);
        }

        void gcMultiRow1_ResizeTipTextNeeded(object sender, ResizeTipTextNeededEventArgs e)
        {
            // Customize 1nd column's resize tip and 1nd rows resize tip. 
            if (e.CellIndex == 0 || e.RowIndex == 0)
            {
                string direction = "height";
                if (e.Direction == Orientation.Horizontal)
                {
                    direction = "width";
                }

                e.ResizeTipText = "Cell " + direction + " resize from " + e.OldValue + " to " + e.NewValue;
            }
        }
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        ' Use AllowUserToResize property to disable/enable MultiRow control's UIResize.
        Me.gcMultiRow1.AllowUserToResize = True

        ' Show resize tip when UI resize.
        Me.gcMultiRow1.ShowResizeTip = ResizeMode.Both
    End Sub

    Private Sub gcMultiRow1_ResizeTipTextNeeded(ByVal sender As Object, ByVal e As ResizeTipTextNeededEventArgs) Handles gcMultiRow1.ResizeTipTextNeeded
        ' Customize 1nd column's resize tip and 1nd rows resize tip. 
        If e.CellIndex = 0 OrElse e.RowIndex = 0 Then
            Dim direction As String = "height"
            If e.Direction = Orientation.Horizontal Then
                direction = "width"
            End If
            e.ResizeTipText = "Cell " + direction + " resize from " + e.OldValue.ToString() + " to " + e.NewValue.ToString()
        End If
    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

GcMultiRow Class
GcMultiRow Members

 

 


Copyright © GrapeCity, inc. All rights reserved.