Results 1 to 6 of 6

Thread: HOW to checkbox in column 0 of msflexgrid

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,652

    HOW to checkbox in column 0 of msflexgrid

    HOW to insert a checkbox in column 0 of msflexgrid?

  2. #2
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,448

    Re: HOW to checkbox in column 0 of msflexgrid

    Example:
    Attached Files Attached Files
    Sam I am (as well as Confused at times).

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,652

    Re: HOW to checkbox in column 0 of msflexgrid

    Quote Originally Posted by SamOscarBrown View Post
    Example:
    GREAT! TKS

    But is possible to maintain in live the current clicked cell, and uncheck all if are checked?

    for example:

    if i check cell 5 in column 0, i need to unceck the other checked cell in column 0 if are checked?

  4. #4
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,704

    Re: HOW to checkbox in column 0 of msflexgrid

    1) Keep an "associated" Array of Booleans
    2) After checking a cell to True (Click-Event?), zero out the whole array (API-Call?), set the corresponding Array-Member to True
    3) Run through the array and assign the boolean-value to the corresponding Checkbox

    Yeah, probably overkill.
    I'm sure there are easier ways

    EDIT
    1) No array neccessary
    2) After checking a cell to True (Click-Event?), Run through your column setting all Checkboxes to False, SKIPPING the one cell you clicked on

    For both Approaches: No Idea if setting the Checkbox through code fires the Click-Event again.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,652

    Re: HOW to checkbox in column 0 of msflexgrid

    Quote Originally Posted by Zvoni View Post
    1) Keep an "associated" Array of Booleans
    2) After checking a cell to True (Click-Event?), zero out the whole array (API-Call?), set the corresponding Array-Member to True
    3) Run through the array and assign the boolean-value to the corresponding Checkbox

    Yeah, probably overkill.
    I'm sure there are easier ways

    EDIT
    1) No array neccessary
    2) After checking a cell to True (Click-Event?), Run through your column setting all Checkboxes to False, SKIPPING the one cell you clicked on

    For both Approaches: No Idea if setting the Checkbox through code fires the Click-Event again.
    Tks Bro, but not for me.

  6. #6
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,144

    Re: HOW to checkbox in column 0 of msflexgrid

    The MSFlexGrid doesn't have checkboxes, you can only fake it with images.
    Use the vbFlexGrid by Krool, you can find it in the codebank

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