int EditField::Insert(int pos, const WString& itext) { // omitted many unchanged lines // // the following test might need to be rewritten // taking the Format/Scan effect into account // if(ins.GetCount() + text.GetCount() > maxlen) { BeepExclamation(); return 0; } //changes ====================== int len=text.GetLength(); text.Insert(pos, ins); SetData(GetData()); // might be smarter way to achieve it len-=text.GetLength(); Update(); return -len; }