473,465 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

TextBox help!....

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
me 4 lines, but when I use:

m_TextBox_Desc->Text = database[L"Description"]->ToString();
array<System::String^>^ tempArray = gcnew array<System::String^>(
m_TextBox_Desc->Lines->Length );
tempArray = this->m_TextBox_Scripture->Lines;

I only get 1 line, How come? In MFC VC++ you can use functions
GetLineCount() and GetLine(n, (LPTSTR)pszText, sizeof(pszText)). Where
are the line breaks in the textBox?

Thanks for your help!..
Mar 11 '06 #1
1 1438

"Developer" <de*******@developer.info> wrote in message
news:Of**************@tk2msftngp13.phx.gbl...
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 me
4 lines, but when I use:

m_TextBox_Desc->Text = database[L"Description"]->ToString();
array<System::String^>^ tempArray = gcnew array<System::String^>(
m_TextBox_Desc->Lines->Length );
tempArray = this->m_TextBox_Scripture->Lines;

I only get 1 line, How come? In MFC VC++ you can use functions
GetLineCount() and GetLine(n, (LPTSTR)pszText, sizeof(pszText)). Where
are the line breaks in the textBox?

Thanks for your help!..


Your problem stems from the fact that you stored a single string in the text
property of your text box that *appears* to be broken into substrings
because of the WordWrap property setting.
If you entered multiple lines into your text box through your interface
like:
"one" <Enter>
"two" <Enter>, etc.
each line would be stored as a separate element in your array. This is true
because of the escape sequences placed in your entry when the <Enter> key is
struck.
OTOH, if you enter "OneTwoThreeFourFiveSixSevenEight" (etc.) through your
interface (even though the entry will *appear* to be broken up into multiple
lines in your text box, it is a single string and will be treated as such.
Mar 11 '06 #2

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

Similar topics

0
by: Jonas L | last post by:
Hi, I need to create a textbox which acts as a normal textbox but with the following extra requirements: 1) In-focus color, when the textbox gets focus the backcolor property of the textbox...
4
by: Jurjen de Groot | last post by:
I'm developing a ASP.NET/VB.NET web application. (VS.NET 2003) I've created several webpages, but on two pages one textbox colors yellow (the background) and I can't get the background to appear...
0
by: Newasps | last post by:
Hi guys, I have a problem with UpdateCommand Event. In tihs event Ä°'m creating required controls to get that controls' values and also get them. But when I try to get updated values I'm getting the...
2
by: Alex Shirley | last post by:
HI I'm trying to iterate through all the textboxes on a webpage and trim them for spaces. i.e. If a user enters " hello world " we correct it to "hello world" So far I've come up with...
1
by: Shilpi Chaudhry | last post by:
I have a forloop which I use to create textboxes - but unfortunately all of them have the same ids - I need to assign different ids to these textboxes creeated in the loop so that I can retrieve...
19
by: hamil | last post by:
I have a form with one button, Button1, and a Textbox, Textbox1 I have a class, class1 as follows. Public Class Class1 Public DeForm As Object Sub doit() DeForm.Textbox1.text = "It works"...
2
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...
8
by: Filipe Marcelino | last post by:
Hi, I'm trying to create a textbox inheriting from the standard textbox. I would like to: 1. repaint the textbox border; 2. define a color for that border; Till now I made this:
0
KalariaNitya
by: KalariaNitya | last post by:
Hello, could anybody help me? i have gridview, inside gridview i have one Update button & textbox update button update the quantity entered in textbox. i want to update the quantity on textbox on...
6
by: john | last post by:
I have the following textbox setup with Text & ToolTip Bindings as follows; I'm using Visual Studio 2008 VB: <asp:TextBox ID="txtDay1" runat="server" Text='<%# Eval("Day1") %>'...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.