GrapeCity Forums

The GrapeCity Message Boards
Welcome to GrapeCity Forums Sign in | Join | Help
in Search

Picture celltype question

Last post 10-26-2009, 11:37 PM by yianeco. 4 replies.
Sort Posts: Previous Next
  •  10-25-2009, 10:14 AM 84130

    Picture celltype question

    When in design environment selecting a picture cell and opening with right click the properties form there is an option to clear the cell.

    How do I do the same in runtime (clear (remove) the picture from a specific cell)?

    Yiannis

  •  10-26-2009, 3:15 AM 84135 in reply to 84130

    Re: Picture celltype question

    Yiannis,

    You can use the ClearRange method of Spread at runtime and set it's DataOnly parameter to False, this will clear the data as well as the formatting information of the cell.

    fpSpread1.Col = 1
    fpSpread1.Row = 1
    fpSpread1.CellType = CellTypePicture
    fpSpread1.TypePictPicture = fpSpread1.LoadPicture("C:\Face.ico", PictureTypeICO)
    fpSpread1.ClearRange 1, 1, 1, 1, False

    Thanks


    Suresh Singh Dasila
    GrapeCity FarPoint
  •  10-26-2009, 11:50 AM 84160 in reply to 84135

    Re: Picture celltype question

    I have tried clearrange with false but it doesn't seem to work for picture cell type.

     Yiannis

  •  10-26-2009, 3:46 PM 84177 in reply to 84160

    Re: Picture celltype question

    Hello,

    With Spread 8 v8.0.07 , the code  provided by Suresh seems to be working absolutely fine, I would request you to please test it with the same and feel free to share your observation.

    The code I tried looks like,

    Private Sub Command1_Click()
    fpSpread1.ClearRange 2, 3, 2, 3, False
    End Sub
    Private Sub Form_Load()
    fpSpread1.Col = 2
    fpSpread1.Row = 3
    fpSpread1.RowHeight(3) = 25
    fpSpread1.ColWidth(2) = 5
    fpSpread1.CellType = CellTypePicture
    fpSpread1.TypePictPicture = LoadPicture("D:\ImagesIcon\ico\bin full.ico")
    fpSpread1.TypePictStretch = True
    fpSpread1.TypePictMaintainScale = True
    End Sub

    Clicking on the Command Button Clears the Cell Type from Cell(3,2).

    Thanks,

     


    Deepak Sharma
    GrapeCity FarPoint
  •  10-26-2009, 11:37 PM 84183 in reply to 84177

    Re: Picture celltype question

    My mistake. It does work but all cells in the range must be a picture cell type.

    Yiannis

View as RSS news feed in XML
     FarPoint Forums Home