Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6686799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:12:49+00:00 2026-05-26T05:12:49+00:00

In my quest to smoothly update TextBox characters programmatically, I happened upon the TextBox.Lines

  • 0

In my quest to smoothly update TextBox characters programmatically, I happened upon the TextBox.Lines property. From its signature

[LocalizableAttribute(true)] 
public:
property array<String^>^ Lines {
    array<String^>^ get ();
    void set (array<String^>^ value);
}

it appears to offer read-write access, however when I update a single line I don’t see the update apply within the debugger nor on-screen. Why does MicroSoft publish misleading headers when it could simply omit the set accessor from the property declaration?

The MSDN entry http://msdn.microsoft.com/en-US/library/system.windows.forms.textboxbase.lines%28v=VS.80%29.aspx offers some confusing advice:

NoteNote

By default, the collection of lines is a read-only copy of the lines in the TextBox. To get a writable collection of lines, use code similar to the following: textBox1.Lines = new string[] { "abcd" };

But that is not getting any lines at all but instead is setting them. Does that code snippet have further significance in allowing individual lines to be updated? If so, what am I missing?
EDIT
Jon, here’s how I thought I had updated it

for ( int counter = 0; counter < lineStrideInBytes - NEWLINECHARCNT; counter++ )
{
    int srcI = LineBeingWrittenI * (lineStrideInBytes) + counter;
    replacedLine->Append(TextBoxStr[srcI]);
}
replacedLine->AppendLine(); //NEWLINECHARS
replacedLine[col] = chr; //Updated char
textBox1->Lines[LineBeingWrittenI] = replacedLine->ToString();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:12:50+00:00Added an answer on May 26, 2026 at 5:12 am

    Basically when you read the property, it will make a copy. If you change the returned array, that won’t do anything in itself but you can always set the value back. For example (C#):

    string[] lines = textBox.Lines;
    lines[5] = "Updated!";
    textBox.Lines = lines;
    

    The important thing here is that you’re writing to the property. Remember that a property is just a getter/setter pair; it’s calling the setter that changes the lines in the text box.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my quest to transition from a decade of C++ to Ruby, I find
Quest I am looking to fetch rows that have accented characters. The encoding for
Which is a better way to select ans and quest from the table? SELECT
The Quest I'm trying to talk to a SRCDS Server from node.js via the
$('#quest').click(function() { $('#replaceit').load('class/cars.php?q=true',function(){$('#replaceit').collapsible('refresh');}); cannot call methods on collapsible prior to initialization; attempted to call
I have in schema.yml: Quest: columns: yes_no: { type: boolean, notnull: true } answer:
On a quest to migrate some new UI into Managed/C# land, I have recently
In the quest for localization I need to find all the string literals littered
I'm using the Quest AD cmdlets, particularly Get-QADUser, to pull a list of users
In my quest to learn javascript (which seems to be my latest source of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.