>I am trying to detect when a user moves to a different record in a grid. I recorded the following events from the debugger which would work fine if the mousedown event of the grid executed.
>
>The grid object's name is element.
>
>wizard_master2.element.MouseMove(0, 0, 39, 219)
>wizard_master2.element.column8.MouseMove(0, 0, 39, 219)
>wizard_master2.element.MouseDown(1, 0, 39, 219)
>The above event is where I calculate if the position is a different record. If the user clicked on a different record I set lRecordChange to TRUE.
>
>wizard_master2.element.BeforeRowColChange(3)
>The above event I check to see if lRecordChange is TRUE and the current state of the grid is "ADD" I prompted the user with a "Save transaction?" If the user cancels I issue a NODEFAULT which places the cursor back in the last activate record.
>
>wizard_master2.element.column1.text1.RangeLow()
>wizard_master2.element.column1.text1.RangeHigh()
>wizard_master2.element.column1.text1.Valid()
>wizard_master2.element.column1.text1.LostFocus()
>wizard_master2.element.column8.btn.When()
>wizard_master2.element.column8.btn.GotFocus()
>wizard_master2.Paint()
>wizard_master2.element.AfterRowColChange(1)
>The above event is where I record the new current record position which is used to compare in the BeforeColChange event.
>
>wizard_master2.element.column8.btn.MouseDown(1, 0, 39, 219)
>wizard_master2.element.MouseUp(1, 0, 39, 219)
>wizard_master2.element.column8.btn.MouseUp(1, 0, 39, 219)
>
>The problem again is the debugger says the MouseDown event fired for the grid but the code in the event didn't execute.
>
>Any ideas?
>
>Thanks,
>Bill
Try using mdown() instead.
if mdown()
lnBottom = .top+.headerheight+.relativerow * .rowheight
lnTop = lnBottom - this.rowheight
lnMouseRowPos = mrow(wontop(),3)
lnMouseColPos = mcol(wontop(),3)
llChangingRow = !(between(lnMouseRowPos,lnTop, lnBottom) ;
and between(lnMouseColPos,.left,.left+.width))
Cetin