My program uses a richtext box and for absolutely no reason, the undo/redo functions DO NOT WORK. They used to and now they don't for no reason.

What would be a good way to make my own? I figured maybe an array of richtext boxes and everytime the text is changed it copies into another value of the array and undo/redo transversus the array, but it also sounds like a huge memory hog and a very un-efficient way of doing things