Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

rCell Field, EditSetupEventArgs Class

The location of the cell.

Class: EditSetupEventArgs
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public readonly Rectangle rCell;
Public ReadOnly rCell As Rectangle

Comments

The location of the cell.

Examples

C#

                comboBox1.Parent = sftTree1;

                comboBox1.Items.Clear();
                comboBox1.Items.AddRange(new string[] { "Selection 1", "Selection 2", "Selection 3", "Selection 4", "Selection 5" });

                comboBox1.Text = e.Cell.Text;
                int h = comboBox1.Height;

                Rectangle r = e.rCell;
                // limit the control to the left (and only) pane
                r.Intersect(sftTree1.Splitter.Left.ItemsArea);
                int vOffs = (r.Size.Height - comboBox1.Height) / 2;
                comboBox1.Location = new Point(r.Location.X, r.Location.Y + vOffs);
                comboBox1.Width = r.Width;

                // make it visible and enable it

VB.NET

    If e.Cell.ColumnIndex = 1 Then
        ' We use a textbox for column 1 (remember, column 0 is not editable,
        ' because of the EditAllowed event
        ' set all textbox properties
        textBox1.Parent = sftTree1     ' make the tree control the parent window

        textBox1.Text = e.Cell.Text
        Dim h As Integer = textBox1.Height
        Dim vOffs As Integer = (e.rCell.Size.Height - textBox1.Height) / 2
        textBox1.Location = New Point(e.rCell.Location.X, e.rCell.Location.Y + vOffs)
        textBox1.Width = e.rCell.Width

        ' make it visible and enable it
        textBox1.Enabled = True
        textBox1.Visible = True

See Also EditSetupEventArgs Class | Classes | SftTree/NET 2.0



Spring Break!

Our offices will be closed this week (March 18 through March 22).

We'll be back March 24 to address any pending sales and support issues.