GrapeCity MultiRow Windows Forms Documentation
ShowResizeTip Property
Example 


Gets or sets a value that indicates in which direction to show the resize tip.
Syntax
<SRDescriptionAttribute("Indicates whether the resize tip is shown when users resize the cells horizontally or vertically.")>
<DefaultValueAttribute()>
<SRCategoryAttribute("Appearance")>
Public Property ShowResizeTip As ResizeMode
Dim instance As GcMultiRow
Dim value As ResizeMode
 
instance.ShowResizeTip = value
 
value = instance.ShowResizeTip
[SRDescription("Indicates whether the resize tip is shown when users resize the cells horizontally or vertically.")]
[DefaultValue()]
[SRCategory("Appearance")]
public ResizeMode ShowResizeTip {get; set;}

Property Value

One of the ResizeMode values. The default is ResizeMode.None.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe specified value is not one of the ResizeMode values.
Remarks

Typically, the text in the tip is the width or height of the cell in pixels. Handle the ResizeTipTextNeeded event and change the ResizeTipTextNeededEventArgs.ResizeTipText property in the ResizeTipTextNeededEventArgs to customize the text in the resize tip.

The resize tip is shown at the top of the mouse position when the resize starts. Once the resize operation begins, the position of the resize tip does not change.

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
AllowUserToResize Property

 

 


Copyright © GrapeCity, inc. All rights reserved.