0

I need to transfer the 1st line of Memo1 to Memo2, and move the remaining lines of Memo1 up.

These are the expected results:

image

image

Michael
  • 41,989
  • 11
  • 82
  • 128

1 Answers1

1

Like this:

Memo2.Lines.Add(Memo1.Lines[0]);
Memo1.Lines.Delete(0);
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • sir Remy, does Memo1.Lines[1] will automatically go to first line? in my example the items in memo1 should goes up when I transfer a single row from memo1 to memo2. – justine yeojson Barcelo Aug 24 '16 at 05:10
  • Yes, the remaining lines will move up when you delete a line. You could have just tried it and seen what happens. – Remy Lebeau Aug 24 '16 at 05:16
  • sir Remy, does Memo1.Lines[1] will automatically go to first line? in my example the items in memo1 should goes up when I transfer a single row from memo1 to memo2. how will I do that? Btw Thanks Sir Remy. – justine yeojson Barcelo Aug 24 '16 at 05:18
  • 1
    You already asked that and I already answered (**yes**, the lines will move up) There was no need to ask it again. Did you even **TRY** the code I gave you yet? – Remy Lebeau Aug 24 '16 at 05:19
  • Thank you so much sir Remy, this will solved my problem, I am already stuck by 2 days by this. Thank you so much. – justine yeojson Barcelo Aug 24 '16 at 05:22