473,663 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TextBox for multiple lines of text strings

Hi,

I have a TextBox, textAddress, that's defined as an array of text
strings.

Currently I only have a single line of text in it:

textAddress.Tex t = "100 America Avenue, New York, NY
12300";

However, I want to add another line for a name, such as "Mr. John
McAdams". I guess I'll need to create an array that contains both
strings (name and address). How can I get both strings displayed on
separate lines in textAddress in C# code?

Thanks!

-Emily

Jan 4 '07 #1
1 1667
In c# the string "\r\n" is equal to VB's vbCrLf

That steps any line of text to the next line. O, and don't forget to set the
multiline proporty on your text box.

David

"Fir5tSight " wrote:
Hi,

I have a TextBox, textAddress, that's defined as an array of text
strings.

Currently I only have a single line of text in it:

textAddress.Tex t = "100 America Avenue, New York, NY
12300";

However, I want to add another line for a name, such as "Mr. John
McAdams". I guess I'll need to create an array that contains both
strings (name and address). How can I get both strings displayed on
separate lines in textAddress in C# code?

Thanks!

-Emily

Jan 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
4313
by: kfrost | last post by:
I know this is probably simple but I have a C# form and the class for the form is called sbaSynch. I have a textbox name txtServerName. I'm creating a class to manipulate XML functions so I added a class to project and it's named XmlApi(). In the XmlAPI() class I have simple code as following XmlAPI() { string str = "Some Text";
2
12584
by: simon | last post by:
hello, new to vb.net, have a few questions about DataGrid. I have a dataGrid that is working pulling a dataset back from a stored proc and binding to the datagrid for display the datagrid's first column is a textbox(TemplateColumn), the other 3 columns are just display(BoundColumn). (1) if the value of the textbox is 0, then i'd like to change it null, so the box is empty
1
1458
by: Developer | last post by:
VC++ 2005 Express Edition: I have a textBox with the properties: this->m_TextBox_Desc->Multiline = true; this->m_TextBox_Desc->WordWrap = true; this->m_TextBox_Desc->ScrollBars = ScrollBars::Vertical; I read my database with a description for the user. I want to load each line into a listView. With wordWrap and the Width of the textBox gives
10
2454
by: garyusenet | last post by:
I have a multiline textbox. The size of the text box should be 75 characters wide, and 5 lines in height like this: - <---75 characters--> <---75 characters--> <---75 characters--> <---75 characters--> <---75 characters-->
0
1215
by: Fir5tSight | last post by:
Hi, I have a TextBox, textAddress, that's defined as an array of text strings. Currently I only have a single line of text in it: textAddress.Text = "100 America Avenue, New York, NY 12300";
6
16845
by: =?Utf-8?B?SGFucyAtIERpYUdyYXBoSVQgLQ==?= | last post by:
Hi! sorry for a dumb question. I have a textbox where multiline=true and I want to set the scrolbar from none to vertical when the textbox have more then f.ex. 5 lines, or reverse. How can I count the amount of lines in a textbox? Best regards
4
7233
by: =?Utf-8?B?QmVuIFIu?= | last post by:
Hi, I've got a webservice that just returns a string, and in the middle of the string, I use a controlchars.newline. When I set this string to the text property of a textbox, it shows up as one line, with the newline just appearing as a square. If I do the same with a richtextbox, it looks correct. Do the two handle UTF-8 strings differently? -Ben
9
11940
by: Phill W. | last post by:
VB.Net 2005 SP1 Windows Forms Application What's the fastest way to append text to a TextBox? I have an application that monitors data written to text files. It needs to scan some fairly hefty files (typically ~15MB) and scanning the file pulling out the rows I want (typically ~10,000 of them) takes /comfortably/ under three seconds. In normal usage, this application will "follow" the end of these files as they are written to, so it...
10
3046
by: karan1981 | last post by:
Hi, I have a user control that has a textbox. This user control is placed in a form at runtime. This form gives a string to the user control and the textbox is to show this in multiple lines.(i do so using a property to set the textbox's text property) So in designer view i set the multiline property to TRUE and the word wrap property to TRUE. This enables the text to be shown in multiple lines at runtime. But the textbox size does not...
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8858
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.