473,394 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Compact Framework: Counting lines in a TextBox

Hi!

I have a multi-line text box in a compact framework c# application. I
need a method to calculate the excact number of lines of the textbox
and a method to calculate the number of used lines after the text box
was filled with a string.

Any ideas?

Greetings,
Arne

Feb 3 '06 #1
4 2640
Arne,

The easiest way I can see is to access the Lines property. This will
expose an array of strings. Once you do that, you can use the Length
property of the array to determine the number of lines.

However, this might be very inefficient as the number of lines
increases, since it involves some work on the control's part to determine
the lines.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"anoehre" <an*******@gmx.de> wrote in message
news:11********************@z14g2000cwz.googlegrou ps.com...
Hi!

I have a multi-line text box in a compact framework c# application. I
need a method to calculate the excact number of lines of the textbox
and a method to calculate the number of used lines after the text box
was filled with a string.

Any ideas?

Greetings,
Arne

Feb 3 '06 #2
Thanks. But in cpmpact framework there is no lines property.

Feb 3 '06 #3
You can find how to get the number of lines in a CF multi-line TextBox from
the example linked below.
http://blog.opennetcf.org/ayakhnin/P...d-ebe4d28f8b2f

--
Tim Wilson
..NET Compact Framework MVP

"anoehre" <an*******@gmx.de> wrote in message
news:11********************@z14g2000cwz.googlegrou ps.com...
Hi!

I have a multi-line text box in a compact framework c# application. I
need a method to calculate the excact number of lines of the textbox
and a method to calculate the number of used lines after the text box
was filled with a string.

Any ideas?

Greetings,
Arne

Feb 3 '06 #4
Thanks a lot. It works.

Feb 3 '06 #5

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

Similar topics

1
by: boble | last post by:
Sorry, it's may be off topic ;_((( The following article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k3/ht ml/winmob03.asp states that a.. Microsoft Windows .NET...
2
by: paul | last post by:
I have developed an application for pocket pc that requires multiple forms to be open at any one time. The user is able to flick from one to the other, making changes to each as and when necessary...
5
by: Adam | last post by:
Hi, How do i listen for windows messages in c# on compact.net? I have a window containing an instantiation of the HTML viewer control, which is a child of the main form. As the compact...
1
by: Carlos Lozano | last post by:
I have a windows form (compact framework) which has three hidden controls (label, textbox and listbox) at startup. The controls are enabled, set visible and shown programatically but I am not able...
3
by: HDB | last post by:
Ok. I have a windows form with a textbox for displaying certain messages. Multiline=true and wordwrap=true. I want to know the amount of the lines currently showing. That should not be any...
1
by: Davie | last post by:
I am experiencing a problem with AuthHeaderValue. I have implemented web services which use authentication through AuthHeaderValue. This works perfectly for any Windows application but it fails...
5
by: bob | last post by:
Hi Using 2003 - targeting the compact framework (c#), but would like to do most development using the full.net (manually leaving out stuff not in the compact framework). Q. Trying to find a...
2
by: spamlaanbroek | last post by:
The .NET WebBrowser control in the Compact Framework 2.0 is a major headache. Once it takes the focus (e.g. by the user tapping on it) it keeps it and keyboard events are not passed to the form...
6
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.