Focus on a Cell

Posted by: fhcnunes-fp on 8 September 2017, 12:36 pm EST

  • Posted 8 September 2017, 12:36 pm EST

    Hello,
    Active cell has a mark that indicates the focus. This mark is a rectangle with a border diferent of the border of sheet lines. Is it possible to change the border of focus in cells with some characteristics, like  locked cells? Is there a method that permits me to change the border style of focus rectangle when I enter in a specific cell? If it is necessary some code, could you send me a sample of this code?
    Thanks.
  • Replied 8 September 2017, 12:36 pm EST

    The focus rectangle is applied to the entire spread and does not take into account characteristics of particular cells.  The beta of  version 3 does include some different types of focus rectangles and you could query if you are in one of those cells and then change the rectangle.  Or create your own rectangle and do the same.
  • Replied 8 September 2017, 12:36 pm EST

    Bob,
    Which methods can I use to change the type of focus rectangle.
    I am using beta of version 3.
    Thanks.
  • Replied 8 September 2017, 12:36 pm EST

    You can do the following, for example...

    FpSpread1.FocusRenderer = New FarPoint.Win.Spread.MarqueeFocusIndicatorRenderer(Color.Orange, 2)

    There is also the DefaultFocusIndicatorRenderer, ImageFocusIndicatorRenderer and SolidFocusIndicatorRenderer.  Or you can create your own...

    Dim bm As
    New Bitmap(2, 2)
    bm.SetPixel(0, 0,
    Color.Black)
    bm.SetPixel(0, 1, Color.Red)
    bm.SetPixel(1, 0,
    Color.Red)
    bm.SetPixel(1, 1, Color.Black)

    Dim cfi As New FarPoint.Win.Spread.CustomFocusIndicatorRenderer(bm,
    2)

    FpSpread1.FocusRenderer = cfi



Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels