Reg: setting a mask for datetime cell

Posted by: subba on 8 September 2017, 1:58 pm EST

  • Posted 8 September 2017, 1:58 pm EST

    hi,


    i want to know how i can set mask for a datetime cell to just show up time part.


    i also want know from where i can get the API to browse through.


     


    Thanks


    subba


     

  • Replied 8 September 2017, 1:58 pm EST

    Hello Subba,


    In order to show only Time in a cell you can use DateTimeCellType and set the DateTimeFormat to UserDefined.Now set the Format as you want, Below is the code snippet that does the same,


    Dim dt As New FarPoint.Win.Spread.CellType.DateTimeCellType()


    dt.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined


    dt.UserDefinedFormat = "hh:mm"


    FpSpread1.ActiveSheet.Cells(0, 0).CellType = dt


    FpSpread1.ActiveSheet.Cells(0, 0).Value = DateTime.Now.TimeOfDay


     


     


    Hope it will help you.


    Thanks & Regards,


     

Need extra support?

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

Learn More

Forum Channels