Multiselect when .HorizontalScrollBarHeight = 0;

Posted by: todo on 8 September 2017, 12:34 pm EST

  • Posted 8 September 2017, 12:34 pm EST

    I have created a project, added a spread and the code:

    InitializeComponent(); //AutoAdded
    fpSpread1_Sheet1.ColumnHeader.Visible =
    fpSpread1_Sheet1.RowHeader.Visible = false;
    fpSpread1_Sheet1.ColumnCount = 2;
    fpSpread1_Sheet1.RowCount = 0;
    fpSpread1_Sheet1.SelectionUnit =
    fpSpread1.HorizontalScrollBarHeight = 0; //Can not reporduce prior to adding this!

    When running this project, multiselect rows by click and drag with mouse, passing the top or buttom of spread control I get:

    System.DivideByZeroException occurred

      Message="Attempted to divide by zero."



           at FarPoint.Win.Spread.SpreadView.a(Object A_0, EventArgs A_1)

           at System.Windows.Forms.Timer.OnTick(EventArgs e)

           at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)

           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

           at System.Windows.Forms.Application.Run(Form mainForm)

           at MYCode.Main....


    Thankful for your help,


  • Replied 8 September 2017, 12:34 pm EST


    I am not able to reproduce this issue. Make sure you are using the latest maintenance release (2.5.x010). If you are could you post a small zipped project reproducing this issue for us to debug the problem?

  • Replied 8 September 2017, 12:34 pm EST

    Hi again,

    .HorizontalScrollBarHeight = 0 did not work at all in the latest release but just adding
    .HorizontalScrollBarPolicy worked in the version I'm using (2.5.2007.2005).

    Thanks and regards,

  • Replied 8 September 2017, 12:34 pm EST


    It turns out this was a bug in the Spread for Windows forms product that has now been fixed. You can not set the HorizonatalScrollBarHeight to 0. The correct way to get rid of the scrollbar is what you are now doing by setting the HorizontalScrollBarPolicy property.

Need extra support?

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

Learn More

Forum Channels