473,396 Members | 1,738 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,396 software developers and data experts.

How to Add Spaces and Lines in Message Box?

Hiren Joshi
Hi,

I am displaying a message in Message Box but it comes in only 1 line....

Is there any way i can make 2 or 3 lines wherever i want in Message Box display? I mean to say I need Line Break in Message Box.

E.g. My Message is supposed to read as follows:

"You had Enough Attempt of Login,

You have Tried 3 Unsuccessful Logins,

System Terminating"

Please help,

Hiren
Feb 13 '08 #1
22 32726
debasisdas
8,127 Expert 4TB
try to use this
Expand|Select|Wrap|Line Numbers
  1. msgbox "You had Enough Attempt of Login" & chr(13) & "You have Tried 3 Unsuccessful Logins" & chr(13) & "System Terminating"
  2.  
Feb 13 '08 #2
You are Great Debasis,

It works... What is chr(13) for? is it for Line Break or Next Line?

Thanks Buddy

Hiren
Feb 13 '08 #3
debasisdas
8,127 Expert 4TB
It is better to use vbNewLine in place of chr(13).
Feb 13 '08 #4
werks
220 100+
Hi Hiren try this another Alternative:

Expand|Select|Wrap|Line Numbers
  1. MsgBox "You had Enough Attempt of Login," + vbCrlf + "You have Tried 3 Unsuccessful Logins," + vbCrlf + "System Terminating"
  2.  
--
Kenneth
"Better Than Yesterday"
Feb 13 '08 #5
debasisdas
8,127 Expert 4TB
13 is the keycode of ENTER KEY.
Feb 13 '08 #6
debasisdas
8,127 Expert 4TB
and vbCrlf is VisualBasicCarrriageReturnLineFeed.
Feb 13 '08 #7
Yes Thats Cool as well...

Thanks
Feb 13 '08 #8
Thanks Debasis, Thanks Werks...

It was helful information for me... I might post couple of posts tomorrow ...

Thanks 2 Both of you once again......

Hiren
Feb 13 '08 #9
werks
220 100+
We are happy to help you

--
Kenneth
"Better Than Yesterday"
Feb 13 '08 #10
Killer42
8,435 Expert 8TB
I recommend using vbNewLine, simply because its purpose is so much more obvious. It has the exact same value as vbCRLF.
Feb 14 '08 #11
Any Advance Function for Message Box? Like Changing the Font, Size and Colour? or Aligning the Font in Center?
Feb 14 '08 #12
debasisdas
8,127 Expert 4TB
Any Advance Function for Message Box? Like Changing the Font, Size and Colour? or Aligning the Font in Center?
All those are not supported . You can design your own component for that or can use any third party tool.
Feb 14 '08 #13
QVeen72
1,445 Expert 1GB
Hi,

You can Create a Custom Message Box of ur own. Add A new Form and Show it Modally, Add any number of buttons/ Place a Label Control to display the message, and Play with other Visual Properties like Fore Colour/ Back Color/ Font/ ICon/ Background Picture...

frmMsg.Show 1

Declare a Form Level Public Variable in (frmMsg) , and In ButtonClick, Populate the Variable with Appropriate Values, And check the Value of this Variable in Calling Form..


REgards
Veena
Feb 14 '08 #14
Thanks Once Again Debasis,

Any Hint on Creating Own Component?
Feb 14 '08 #15
debasisdas
8,127 Expert 4TB
You can design your own usercontrol or refer to the previous post by Qveen72 for an easier solution.
Feb 14 '08 #16
Ok I got the Idea,

Thanks Debasis, Veena

I cant see my other post of Auto Generating the Custom No. While Saving Record? I have posted with the codes I have used. Does it normally take long to Appear in the Forum?

Hiren
Feb 14 '08 #17
debasisdas
8,127 Expert 4TB
Ok I got the Idea,

Thanks Debasis, Veena

I cant see my other post of Auto Generating the Custom No. While Saving Record? I have posted with the codes I have used. Does it normally take long to Appear in the Forum?

Hiren
No it is displayed instantly .

The thread is here.
Feb 14 '08 #18
Killer42
8,435 Expert 8TB
No it is displayed instantly .

The thread is here.
That link doesn't work.
Feb 14 '08 #19
whassup guys i dn knw how to do line space in msgbox
which is
Dim year
Dim loan
Dim rate = 0.037
Dim install


loan = CDbl(txtb1.Text)
year = CDbl(txtb2.Text)

install = ((loan + (loan * rate)) / (year * 12))

MsgBox("Loan :" & loan, "year :" & year, "installment :" &install.msgbox = FormatCurrency(install, 2))


got error but whwn a time do nt have any error
can you guys help me to do this programming ?
Dec 5 '11 #20
acctually the error is

A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
Dec 5 '11 #21
Killer42
8,435 Expert 8TB
Sorry for the delay.

I think you'll get a better response to this question in the Visual Basic .NET forum. This one is for the older pre-dotnet versions of VB.
Dec 13 '11 #22
Cjpa
1
Expand|Select|Wrap|Line Numbers
  1. Msgbox("You had Enough Attempt of Login" & vbCrLf & "You have Tried 3 Unsuccessful Logins" & vbCrLf & "System Terminating")
Feb 13 '16 #23

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Ruben | last post by:
Hello. I am trying to read a small text file using the readline statement. I can only read the first 2 records from the file. It stops at the blank lines or at lines with only spaces. I have a...
5
by: qwweeeit | last post by:
Hi all, I need to limit as much as possible the lenght of a source line, stripping white spaces (except indentation). For example: .. . max_move and AC_RowStack.acceptsCards ( self,...
6
by: eddie wang | last post by:
How to keep the spaces before the description line in the following code? Right now, it displays like "Net Income", but I like to have spaces before the words like " Net Income". The database...
6
by: Nathan Sokalski | last post by:
I am using ASP to read code from a text file that I am displaying on my page. Because I do not want the code from the text file to be executed, I used the Server.HTMLEncode() method to display it...
17
by: bearophileHUGS | last post by:
Hello, I know this topic was discussed a *lot* in the past, sorry if it bores you... >From the Daily Python-URL I've seen this interesting Floating Point Benchmark:...
6
by: eight02645999 | last post by:
hi wish to ask a qns on strip i wish to strip all spaces in front of a line (in text file) f = open("textfile","rU") while (1): line = f.readline().strip() if line == '': break print line
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
19
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...
4
by: koutoo | last post by:
If I have a text file that is delimited by spaces, how do I import it and get to comma delimited? Here is a row of data from the text file: 1 1 10:55:14 2 65 8.5 1.4+1.1 ...
1
by: =?Utf-8?B?S2hhcnRvdW0=?= | last post by:
Know somebody out there will laugh a this but i have the following function that opens a certain form based on the password but because there are so many forms, i am getting the 'too many...
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:
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.