473,888 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mutil line txt box

Hello

For a VB novice can anyone help me with the following simple idea.

All I've got on my form is a Textbox, (mulitline = true) and a button.

When I click the button I will have some simple lines of text to be
displayed. How do I have...

Dim addLine As String = "Next Line"
Dim addLine As String = "Another Line"
TextBox1.Text = "Line one"
then the next line display Next Line
and the next display Another Line

What is the newline char? \n
Feb 13 '06
20 1309
One more quick and easy question.
Me.TextBox1.Tex t += "Line Two" & vbCrLf

How can I make that line BOLD?

Thanks again

"jvb" <go*****@gmail. com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Your welcome!

Feb 13 '06 #11
You can't in a standard text box.
You'll need to use the rich text box ... different game altogether!
_______________ _______________ _
The Grim Reaper

"Jason" <ja***@someone. com> wrote in message
news:%2******** *******@TK2MSFT NGP15.phx.gbl.. .
One more quick and easy question.
Me.TextBox1.Tex t += "Line Two" & vbCrLf

How can I make that line BOLD?

Thanks again

"jvb" <go*****@gmail. com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Your welcome!


Feb 13 '06 #12
I was going to say "you're going against convention!"... . but then I checked
my local MSDN and found;

&=
Concatenates a String expression to a String variable or property and
assigns the result to the variable or property.

+=
Adds the value of a numeric expression to the value of a numeric variable or
property and assigns the result to the variable or property. Can also be
used to concatenate a String expression to a String variable or property and
assign the result to the variable or property.

So there you go!
_______________ _______________ ______
The Grim Reaper

"jvb" <go*****@gmail. com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Is there any reason that &= is better than +=? I have always used the
+. Am I going against convention?

Feb 13 '06 #13
Anyone...

when I run this
Me.TextBox1.Tex t += "Line One" & vbCrLf
Me.TextBox1.Tex t += "Line Two" & vbCrLf

I get...

Line One
Line Two

But both lines are selected, is that supposed to be that way? How can I get
rid of the highlighting?

"Jason" <ja***@someone. com> wrote in message
news:OP******** ******@TK2MSFTN GP11.phx.gbl...
Hello

For a VB novice can anyone help me with the following simple idea.

All I've got on my form is a Textbox, (mulitline = true) and a button.

When I click the button I will have some simple lines of text to be
displayed. How do I have...

Dim addLine As String = "Next Line"
Dim addLine As String = "Another Line"
TextBox1.Text = "Line one"
then the next line display Next Line
and the next display Another Line

What is the newline char? \n

Feb 13 '06 #14
"The Grim Reaper" <gr*********@RE MOVEbtopenworld .com> schrieb:
I was going to say "you're going against convention!"... . but then I
checked my local MSDN and found;

&=
Concatenates a String expression to a String variable or property and
assigns the result to the variable or property.

+=
Adds the value of a numeric expression to the value of a numeric variable
or property and assigns the result to the variable or property. Can also
be used to concatenate a String expression to a String variable or
property and assign the result to the variable or property.


Mhm... But I remember the documentation for '&' recommends to use '&' for
string concatenation instead of '+'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Feb 13 '06 #15
Me.TextBox1.Sel ectionStart = 0
Me.TextBox1.Sel ectionLength = 0

(I haven't had cause to use them much before, so experiment with what you
want to achieve)
_______________ _______________ _____
The Grim Reaper

"Jason" <ja***@someone. com> wrote in message
news:u$******** *****@TK2MSFTNG P14.phx.gbl...
Anyone...

when I run this
Me.TextBox1.Tex t += "Line One" & vbCrLf
Me.TextBox1.Tex t += "Line Two" & vbCrLf

I get...

Line One
Line Two

But both lines are selected, is that supposed to be that way? How can I
get rid of the highlighting?

"Jason" <ja***@someone. com> wrote in message
news:OP******** ******@TK2MSFTN GP11.phx.gbl...
Hello

For a VB novice can anyone help me with the following simple idea.

All I've got on my form is a Textbox, (mulitline = true) and a button.

When I click the button I will have some simple lines of text to be
displayed. How do I have...

Dim addLine As String = "Next Line"
Dim addLine As String = "Another Line"
TextBox1.Text = "Line one"
then the next line display Next Line
and the next display Another Line

What is the newline char? \n


Feb 13 '06 #16
Hi,

Try this one with option strict off and be happy

dim a as string = "1"
a += 1

Cor
"The Grim Reaper" <gr*********@RE MOVEbtopenworld .com> schreef in bericht
news:ds******** **@nwrdmz03.dmz .ncs.ea.ibs-infra.bt.com...
I was going to say "you're going against convention!"... . but then I
checked my local MSDN and found;

&=
Concatenates a String expression to a String variable or property and
assigns the result to the variable or property.

+=
Adds the value of a numeric expression to the value of a numeric variable
or property and assigns the result to the variable or property. Can also
be used to concatenate a String expression to a String variable or
property and assign the result to the variable or property.

So there you go!
_______________ _______________ ______
The Grim Reaper

"jvb" <go*****@gmail. com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Is there any reason that &= is better than +=? I have always used the
+. Am I going against convention?


Feb 13 '06 #17
Thanks

Shouldn't that be in the properties of the Text Box?

Also how do you make a one line of text bold?
Me.TextBox1.Tex t += "Line One" & vbCrLf
Me.TextBox1.Tex t += "Line Two" & vbCrLf

"The Grim Reaper" <gr*********@RE MOVEbtopenworld .com> wrote in message
news:ds******** **@nwrdmz01.dmz .ncs.ea.ibs-infra.bt.com...
Me.TextBox1.Sel ectionStart = 0
Me.TextBox1.Sel ectionLength = 0

(I haven't had cause to use them much before, so experiment with what you
want to achieve)
_______________ _______________ _____
The Grim Reaper

"Jason" <ja***@someone. com> wrote in message
news:u$******** *****@TK2MSFTNG P14.phx.gbl...
Anyone...

when I run this
Me.TextBox1.Tex t += "Line One" & vbCrLf
Me.TextBox1.Tex t += "Line Two" & vbCrLf

I get...

Line One
Line Two

But both lines are selected, is that supposed to be that way? How can I
get rid of the highlighting?

"Jason" <ja***@someone. com> wrote in message
news:OP******** ******@TK2MSFTN GP11.phx.gbl...
Hello

For a VB novice can anyone help me with the following simple idea.

All I've got on my form is a Textbox, (mulitline = true) and a button.

When I click the button I will have some simple lines of text to be
displayed. How do I have...

Dim addLine As String = "Next Line"
Dim addLine As String = "Another Line"
TextBox1.Text = "Line one"
then the next line display Next Line
and the next display Another Line

What is the newline char? \n



Feb 13 '06 #18
jvb
To have only one line bold, you have to use a RichTextBox. Select the
text you want and execute this line:

rtb.SelectionFo nt = New Font(rtb.Font, FontStyle.Bold)

where rtb is the RichTextBox.

Feb 13 '06 #19
If I've got this

Me.RichTextBox1 .Text = "In Rich Text Box"
Me.RichTextBox1 .Text &= "Line two" & vbCrLf
How do I make the second line BOLD?

"jvb" <go*****@gmail. com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
To have only one line bold, you have to use a RichTextBox. Select the
text you want and execute this line:

rtb.SelectionFo nt = New Font(rtb.Font, FontStyle.Bold)

where rtb is the RichTextBox.

Feb 13 '06 #20

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

Similar topics

19
10670
by: les_ander | last post by:
Hi, suppose I am reading lines from a file or stdin. I want to just "peek" in to the next line, and if it starts with a special character I want to break out of a for loop, other wise I want to do readline(). Is there a way to do this? for example: while 1: line=stdin.peek_nextline()
7
2819
by: jamait | last post by:
Hi all, I m trying to read in a text file into a datatable... Not sure on how to split up the information though, regex or substrings...? sample: Col1 Col2 Col3 Col4 A0012430 REKAL TVÄTTMEDEL EKOMAX 0,5L ST 75.9000
6
4404
by: mary | last post by:
When we use string line; while (getline(in,line)) { out.write(line.c_str(),line.size()); out.put('\n'); } in.close();
65
12654
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second method was a piece of C code which turned out to be incorrect and incomplete but by modifieing it would still be usuable. The first method was this piece of text:
3
3043
by: Double Echo | last post by:
Hi all, I'm using PHP 4.4.2, and use PHP on both the command-line and the web. I am running PHP on SuSE 10 Linux , in a VMware 5.5 workstation, using Apache 2.0.55 , on my Dell laptop. Everything has been running flawlessly without problems. Very amazing to use VMware, it has worked beautifully. uname -a
9
5219
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still facing problems: Assume that FILE* filePointer; unsigned char lineBuffer;
6
2691
by: Jacob Rael | last post by:
Hello, I have a simple script to parse a text file (a visual basic program) and convert key parts to tcl. Since I am only working on specific sections and I need it quick, I decided not to learn/try a full blown parsing module. My simple script works well until it runs into functions that straddle multiple lines. For example: Call mass_write(&H0, &HF, &H4, &H0, &H5, &H0, &H6, &H0, &H7, &H0, &H8, &H0, _
11
2816
by: xdevel | last post by:
Hi, I don't understand option. if I write: #line 100 "file" I change file numeration to start to line 100 but what "file" ? any example?
19
2464
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
This is an example of the data; 2007/07/27 11:00:03 ARES_INDICATION 010.050.016.002 404.2.01 (6511) RX 74 bytes 2007/07/27 11:00:03 65 11 26 02 BC 6C AA 20 76 93 51 53 50 76 13 48 2007/07/27 11:00:03 52 00 52 02 02 C7 83 D7 07 07 1B 0B 00 00 00 00 2007/07/27 11:00:03 28 0A 06 06 06 06 06 06 06 06 06 06 06 0A 06 06
0
9799
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
11173
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
10434
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
9593
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
7988
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
5810
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
6011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4635
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
4239
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.