Spread Windows Forms 12.0 Product Documentation
EditBaseCellType Constructor(EditBaseCellType)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.CellType Namespace > EditBaseCellType Class > EditBaseCellType Constructor : EditBaseCellType Constructor(EditBaseCellType)
Specified base cell type from which to copy
Copies properties from the specified EditBaseCellType ("copy constructor").
Syntax
'Declaration
 
Public Function New( _
   ByVal g As EditBaseCellType _
)
'Usage
 
Dim g As EditBaseCellType
 
Dim instance As New EditBaseCellType(g)
public EditBaseCellType( 
   EditBaseCellType g
)

Parameters

g
Specified base cell type from which to copy
Example
This example creates a new EditBaseCellType based on a subclass of the object.
public class eb : FarPoint.Win.Spread.CellType.EditBaseCellType
{

public eb()
{
}

public new FarPoint.Win.SuperEdit.AcceptsArrowKeys AcceptsArrowKeys
{
   get
   {
      return base.AcceptsArrowKeys;
   }
   set
   {
      base.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.None;
   }
}
public new FarPoint.Win.Picture BackgroundImage
{
   get
   {
      return base.BackgroundImage;
   }
   set
   {
      base.BackgroundImage = new FarPoint.Win.Picture(Image.FromFile(Application.StartupPath + "\\Trffc14.ico"));
   }
}
}

eb ed = new eb();
ed.BackgroundImage = null;
ed.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.None;
FarPoint.Win.Spread.CellType.EditBaseCellType editor = new FarPoint.Win.Spread.CellType.EditBaseCellType(ed);
fpSpread1.ActiveSheet.Cells[0, 0].CellType = editor;
label1.Text = "The first cell is based on a subclassed EditBaseCellType.  Type something in the first cell and try "+
"to use the arrow keys.  They won't navigate in the cell.";
Public Class eb
Inherits FarPoint.Win.Spread.CellType.EditBaseCellType

Public Sub eb()

End Sub

Public Shadows Property AcceptsArrowKeys() As FarPoint.Win.SuperEdit.AcceptsArrowKeys
   Get
   Return MyBase.AcceptsArrowKeys
   End Get
   Set(ByVal Value As FarPoint.Win.SuperEdit.AcceptsArrowKeys)
   MyBase.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.None
   End Set
End Property

Public Shadows Property BackgroundImage() As FarPoint.Win.Picture
   Get
   Return MyBase.BackgroundImage
   End Get
   Set(ByVal Value As FarPoint.Win.Picture)
   MyBase.BackgroundImage = New FarPoint.Win.Picture(Image.FromFile(Application.StartupPath & "\Trffc14.ico"))
   End Set
End Property

End Class

Dim ed As New eb()
ed.BackgroundImage = Nothing
ed.AcceptsArrowKeys = Nothing
Dim editor As New FarPoint.Win.Spread.CellType.EditBaseCellType(ed)
FpSpread1.ActiveSheet.Cells(0, 0).CellType = editor
See Also

Reference

EditBaseCellType Class
EditBaseCellType Members
Overload List