CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2005
    Posts
    38

    Flexgrid Shift + Mousedown .RowSel issue

    I'm using an MSFlexgrid and a MouseDown event procedure to be able to distinguish between simple clicks and shifted clicks.

    If I only use simple clicks, the value of .RowSel is returned OK.

    If I only use shifted clicks, the value of .RowSel is returned OK.

    However, if in a single run I start with a simple click, the .RowSel value is no longer set for subsequent shifted click events.

    Any particular reason why?

  2. #2
    Join Date
    Mar 2005
    Posts
    38

    Re: Flexgrid Shift + Mousedown .RowSel issue

    Spooky. At the office this works OK.
    I'll go through the code and post the reason (if I find it).

    Regards,
    Nand

  3. #3
    Join Date
    May 2005
    Location
    Sterling Heights, MI
    Posts
    74

    Re: Flexgrid Shift + Mousedown .RowSel issue

    Post the code you are using.

  4. #4
    Join Date
    Mar 2005
    Posts
    38

    Re: Flexgrid Shift + Mousedown .RowSel issue

    The general idea is to mark a row after a first click and if a second, shifted click occurs, mark all the rows between.

    I do have the impression that setting a value in the row makes VB ignore the selection "start". In other words, the code should not react on the first click, but that's exactly what I need.

    I'll give it another try tomorrow (there's no hurry) and get back to you with the result.

    I have added a boiled-down version of the code to this reply. This should give you a better idea of what I want to do.

    Thanks
    Attached Files Attached Files

  5. #5
    Join Date
    Mar 2005
    Posts
    38

    Re: Flexgrid Shift + Mousedown .RowSel issue

    I'm stuck. I tried two things with no result.

    (1) Flexgrid_Click

    VB somehow seems to loose the context of a range defined by .Row and .Rowsel when you change the content of a flexgrid cell. I wrongly assumed this was only the case when you changed the value of .Row (as is stated in the doc).


    (2) FlexGrid_MouseDown

    The strange thing here is that a MouseDown event sets the .Row / .RowSel values but that a Shifted MouseDown event does not set any of these values except if it is used before an Unshifted MouseDown. And even in this situation a second Shifted MouseDown no longer sets the .Row / .RowSel values. Looks as if I must reset something, but what? Else I presume I have to rely on the X/Y coordinates to find out which row was clicked.

    Any ideas?

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

Featured