Discussion Locked

Coding help in visual basic 6.0

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Coding of Redo & undo while creating a notepad in visual basic 6.0 using desktop applications.

5 replies

by peter ritchie

What are you asking?

Are you asking someone to write the redu and undo functionality? 150 pts isn't going to give much incentive.

by mohammad_m_saggaf

Simply you can use a form-scope array of a user-defined type contains an integer or long varible as a index and string varible to contain the last update.
how many Unro or Redo times that will be how many items in the array.
the user-defined couldbe somthing like that:

' For 100 times of undo
Dim StrText(100) As String * 2048 '2 KB string.
' To hold your position.
Dim IntUnDoPos As Integer

Private Sub Form_Load()
IntUnDoPos = 0
End Sub

Private Sub UnDo()
IntUnDoPos = IntUnDoPos - 1
Text1.Text = StrText(IntUnDoPos)
End Sub

Private Sub ReDo()
IntUnDoPos = IntUnDoPos + 1
StrText(IntUnDoPos) = Text1.Text
End Sub

Private Sub Text1_Change()
IntUnDoPos = IntUnDoPos + 1
StrText(IntUnDoPos) = Text1.Text
End Sub

I hope it helped :-)

This discussion is closed to new replies.