Results 1 to 40 of 1650

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

Threaded View

  1. #11

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,728

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by bincong View Post
    Yes, you're right. It does seem like a logical bug. However, I think it also gives users an option. I can either have it initialize with no rows selected, or use a single line of code vsflexgrid.Select 1, 1 to select the first row by default.

    In VBFlexGrid, I could use RowSelected(1) = False to deselect the initially selected row. But if VBFlexGrid receives focus via a mouse click, it will automatically select the first row again, and this won't trigger the SelChange event.

    vsFlexGrid is the exact opposite: receiving focus doesn't automatically select anything. Selecting the first row does trigger the AfterSelChange event.

    Since sometimes I need to use it as a ListBox, I checked the standard ListBox control. Its logic is consistent with vsFlexGrid: receiving focus doesn't automatically select anything (ListIndex = -1), and clicking the first row triggers the Click event.

    Admittedly, my specific need might be relatively niche. Or can the SelectionMode support a ListBox mode like in vsFlexGrid?

    I think VBFlexGrid is already excellent, even more user-friendly than vsFlexGrid. It would be perfect if it could add a LoadArray method.
    Thanks for your feedback. Will put LoadArray on the todo list.

    Well, the SelChange event does not fire but the MultiSelChange event will.

    Having an extra selection mode "ListBox" could be an idea. Will check. It would need to turn AllowMultiSelection to True automatically when that SelectionMode is selected.

    EDIT: I re-checked and receiving the focus does not select anything. So, it's then just the "initialization" is different. And for that I won't introduce a new selection mode which might cause more confusion than anything else.
    Last edited by Krool; Jun 2nd, 2025 at 12:42 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width