Print Page | Close Window

HOWTO: Append one line of text

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Syntax Edit
Forum Description: Topics Related to Codejock Syntax Edit
URL: http://forum.codejock.com/forum_posts.asp?TID=20653
Printed Date: 23 November 2024 at 9:20pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOWTO: Append one line of text
Posted By: mgampi
Subject: HOWTO: Append one line of text
Date Posted: 01 March 2013 at 5:10am
Hi;

I want to use the control as a logger output window for online tcp communication. So I'm looking for the fastes possible way to append a new line of text at the end of the control content buffer and ensure that this line is visible and selected.
Can anyone show me how to solve this.

Regards, 

-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Replies:
Posted By: mgampi
Date Posted: 22 August 2013 at 7:13am
No ideas?


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: DazMan
Date Posted: 28 March 2015 at 5:33pm
Hi Martin,

Not sure if it is the fastest, but works

// Get the last row in the Edit Control, add 1 for newly appended line
int iLastRowNo = m_pEditCtrl->GetRowCount() + 1;
// Add some test text to new Row
m_pEditCtrl->InsertRow(iLastRowNo, _T("This is a new row"), TRUE);
// Move to the newly inserted Row
m_pEditCtrl->GoToRow(iLastRowNo, FALSE);
// Position Caret to end of line, forcing it visible at same time
m_pEditCtrl->SetCurPos(iLastRowNo, m_pEditCtrl->GetLineText(iLastRowNo).GetLength() + 1);

Cheers,
Daz



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net