473,785 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TextBox help!....

VC++ 2005 Express Edition:

I have a textBox with the properties:

this->m_TextBox_De sc->Multiline = true;
this->m_TextBox_De sc->WordWrap = true;
this->m_TextBox_De sc->ScrollBars = ScrollBars::Ver tical;

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"Descriptio n"]->ToString();
array<System::S tring^>^ tempArray = gcnew array<System::S tring^>(
m_TextBox_Desc->Lines->Length );
tempArray = this->m_TextBox_Scri pture->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 1468

"Developer" <de*******@deve loper.info> wrote in message
news:Of******** ******@tk2msftn gp13.phx.gbl...
VC++ 2005 Express Edition:

I have a textBox with the properties:

this->m_TextBox_De sc->Multiline = true;
this->m_TextBox_De sc->WordWrap = true;
this->m_TextBox_De sc->ScrollBars = ScrollBars::Ver tical;

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"Descriptio n"]->ToString();
array<System::S tring^>^ tempArray = gcnew array<System::S tring^>(
m_TextBox_Desc->Lines->Length );
tempArray = this->m_TextBox_Scri pture->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 "OneTwoThreeFou rFiveSixSevenEi ght" (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
2131
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 should be set to a, selectable, in-focus color. 2) Out-of-focus color, when the textbox loses focus the backcolor property of the textbox should be set to a, selectable, out-of-focus color.
4
6912
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 as White as it should by default. Even setting the background to Red doesn't prevent it, the textbox still appears with a yellow background. With or Without using a stylesheet the textbox still appears with a yellow background. The textbox is...
0
1837
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 first values for each control. Please help me. Thanks for any help. Bye Ozer And here's my code: Imports System Imports System.Data Imports System.Data.OleDb
2
2575
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 this:
1
3023
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 their corrs values. Anybody?? Code snippet: <% int y = 7; %>
19
1981
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" End Sub End Class
2
12599
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
8
5096
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
2535
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 ENTER event. i had done below code: page_load()
6
2914
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") %>' Width="30px" ToolTip='<%# Eval("M1") %>'></asp:TextBox>
0
9645
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
10324
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...
0
9949
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
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
6739
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
5380
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...
1
4050
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
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.