Re: Undo on an MSFlexGrid
'Windows API provides an undo function
'Do the following declares:
Declare Function SendMessage Lib "User" (ByVal hWnd As _
Integer, ByVal wMsg As Integer, ByVal wParam As _
Integer, lParam As Any) As Long
Global Const WM_USER = &h400
Global Const EM_UNDO = WM_USER + 23
'And in your Undo Sub do the following:
UndoResult = SendMessage(myControl.hWnd, EM_UNDO, 0, 0)
'UndoResult = -1 indicates an error.
=========================================================
'another approach can be done if you memorize the cell where you enter tha last entry and on 'Undo' button set the cell value to ""
Iouri Boutchkine
[email protected]
Re: Undo on an MSFlexGrid
Try this out ,
When you click the msflex to enter the new selection from the combo,Before updating the new value to the cell, trap the value of the cell using
msflex.textmatrix(msflex.row,msflex.col) in a variable say Temp.
temp=msflex.textmatrix(msflex.row,msflex.col)
Then on the undo button click assign the
msflex.textmatrix(msflex.row,msflex.col)=temp
Let me if this works.
Re: Undo on an MSFlexGrid
Dim temp as string
private Sub Command1_Click()
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, MSFlexGrid1.Col) = temp
End Sub
private Sub Form_Load()
MSFlexGrid1.TextMatrix(1, 1) = "apple"
End Sub
private Sub MSFlexGrid1_Click()
temp = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, MSFlexGrid1.Col)
MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, MSFlexGrid1.Col) = Combo1.Text
End Sub
Here is an example using a combo1 msflexigrid1 and command1 controls
create the three controls and paste the code and add a few items to the list property of the combo1.
PLEASE let me know if you hav any questions