473,511 Members | 15,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2648
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
4949
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
3562
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
1996
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
6342
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
1441
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
1636
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
3316
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
3496
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
16838
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
7252
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,...
0
7153
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...
1
7093
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...
0
5676
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,...
1
5077
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
4743
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...
0
3230
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
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.