Re: datagrid checkbox

From: Agnes (agnes_at_dynamictech.com.hk)
Date: 10/07/04


Date: Thu, 7 Oct 2004 16:06:04 +0800

This is my first post [which answer someone 's question, heeeheee] ** I will
check whether the user click the checkbox on the 3rd column or not .

Try the following code
    Private Sub dgUser_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles dgUser.MouseUp
                Dim hti As DataGrid.HitTestInfo = Me.dgUser.HitTest(e.X,
e.Y)
                If hti.Type = DataGrid.HitTestType.Cell AndAlso (hti.Column
= 2) Then
                    Me.dgUserBranchForm(hti.Row, hti.Column) = Not
CBool(Me.dgUserBranchForm(hti.Row, hti.Column))
        end if
end sub

"Frank" <frank@frank.com> ¦b¶l¥ó news:ck2prl$9f6$1@news1.zwoll1.ov.home.nl
¤¤¼¶¼g...
> Hello,
> I have a forms datagrid with booleanboxes in it. Works fine excepts for
the
> fact that I have to click twice to set/reset the checkmark.
> First click the cell is selected and on the second click the checkmark is
> (un)checked.
> Is there a way to just click once to (un)check?
> Thanks
> Frank
>
>



Relevant Pages

  • Re: Clear checkmark in CheckBox
    ... Rather than using the Click event of the checkbox, ... Private Sub ManagerSignature_BeforeUpdate ... 'checkmark' based on the click event on the following checkbox object ... checkmark from the 'ManagerSignature' check box once the user clicks ...
    (microsoft.public.access.forms)
  • Re: Newbie problem: Long list of user choices
    ... You might try an MSFlexGrid control. ... ' Set checkbox column to bolsd and center-center alignment ... Private Sub MSFlexGrid1_Click ... ' Toggle a checkmark only if the checkmark column was clicked ...
    (comp.lang.basic.visual.misc)
  • Re: SetFocus / GoToControl question
    ... choices, then you need to use the AfterUpdate event, not the OnClick event ... See my first post and adopt your specific code ... The OnClick event will fire anytime you click on the option ... Private Sub Frame15_Click ...
    (microsoft.public.access.gettingstarted)
  • Re: Incrementing Number
    ... You first post was clear and I understood it just fine. ... Add 1 to that [filenumber] ... Populate that new value to the record's field in the table ... Private Sub Form_BeforeUpdate ...
    (microsoft.public.access.formscoding)
  • Re: IF function or otherwise????
    ... You're first post was sent, ... Private Sub Worksheet_SelectionChange ... ' Returns specific value for given case-sensitive entry in A1 ... cell change to Arnold or Brendan or Charlie respectively. ...
    (microsoft.public.excel.worksheet.functions)