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.

MsgBox

Parul Bagadia
188 100+
Hi ppl,
Does somebody know how do we change the font of message we want to display in message box?
And how do we write sth on next line in the same message box without natural termination of line?
in simple words how do we implemnet '\n' in case of message box?
Sep 20 '08 #1
8 1685
debasisdas
8,127 Expert 4TB
you can't change the font or any other setting of messagebox.

to write in multiple line you can add CHR(13) or VBCRLF (VISUAL BASIC CARRIAGE RETURN LINE FEED)

Expand|Select|Wrap|Line Numbers
  1. MSGBOX " THIS IS FIRST LINE " & VBCRLF & " THIS IS SECONDLINE "
Sep 20 '08 #2
Parul Bagadia
188 100+
you can't change the font or any other setting of messagebox.

to write in multiple line you can add CHR(13) or VBCRLF (VISUAL BASIC CARRIAGE RETURN LINE FEED)

Expand|Select|Wrap|Line Numbers
  1. MSGBOX " THIS IS FIRST LINE " & VBCRLF & " THIS IS SECONDLINE "
Thanx.
Can u explain a bit more about CHR(13)?
Sep 20 '08 #3
jg007
283 100+
see here -

http://www.gtwiki.org/mwiki/index.ph...=VB_Chr_Values

Chr just represents characters and the code 13 is for CR or Carriage Return which I believe is a link to the idea of carridge return on a type writer etc

as quoted -

"When you type on a typewriter (for those of you under 25(?) who've never seen one) and reach the end of a line you grasp the "carriage return bar" which would return the carriage to the home position while simultaneously rotating the platen to feed the paper."
Sep 20 '08 #4
debasisdas
8,127 Expert 4TB
Can u explain a bit more about CHR(13)?
Simply i can say CHR(13) is the Enter key on your key board. As enter key carries the cursor to the next line so is CHR(13).

Also try to use vbNewLine
Sep 21 '08 #5
Parul Bagadia
188 100+
Hello people, thanx a lot for ur suggestions but i guess i didnt get the syntax coz i tried all the things u all suggested but its showing syntactical error :-(..
ill post the code here and tell me wats going wrong.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command4_Click()                                          'Command box for help purpose
  2. Dim c As Integer
  3. c = MsgBox("Steps to run this Program: Step 1:Enter the number on which you want to perfom operations  Step 2:Select one of the choices from the Base of input  Step3: Click on the conversion button for obtaining answer  Step4:To exit from the program click on Quit button.", vbOKOnly, "Help to run this program")
  4. End Sub
i want each steps to come in succeeding lines.
Sep 21 '08 #6
You have no syntactical errors. To implement the '\n' use this:

Expand|Select|Wrap|Line Numbers
  1. c = MsgBox("Steps to run this Program:" & vbCrLf & "Step 1:Enter the number on which you want to perfom operations" & vbCrLf & "Step 2:Select one of the choices from the Base of input" & vbCrLf & "Step3: Click on the conversion button for obtaining answer " & vbCrLf & "Step4:To exit from the program click on Quit button.", vbOKOnly, "Help to run this program")
CHR(13)= 13 is also the ascii code for Enter key.
Sep 21 '08 #7
Parul Bagadia
188 100+
You have no syntactical errors. To implement the '\n' use this:

Expand|Select|Wrap|Line Numbers
  1. c = MsgBox("Steps to run this Program:" & vbCrLf & "Step 1:Enter the number on which you want to perfom operations" & vbCrLf & "Step 2:Select one of the choices from the Base of input" & vbCrLf & "Step3: Click on the conversion button for obtaining answer " & vbCrLf & "Step4:To exit from the program click on Quit button.", vbOKOnly, "Help to run this program")
CHR(13)= 13 is also the ascii code for Enter key.
That's what i said in my earlier post; its giving compilation error i tried & vbCrLf &
chr(13) and vbnewline as well... but its not working,....
Sep 22 '08 #8
That's strange.. I just copy-paste your code and works fine.

I insert the vbCrLf into your msg box because i thought there was the problem..
Sep 22 '08 #9

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

Similar topics

1
by: Peter Bassett | last post by:
In my ASP script I call Javascript for a msgbox after the user has submitted the form of their resume information. I saw this example as a way to get a msgbox onto the client from ASP since server...
3
by: JT | last post by:
im trying to use the MsgBox function in the following to display an ASP MsgBox containing text retrieved from the db into a recordset <% set rsMessages= myRecordset msg_text =...
2
by: js | last post by:
Hi all, I currently encounter a problem and it is urgent to me. After calling the MsgBox.Show(), the message box is shown with non-modal mode, what is the possible reason??? This only happen...
4
by: Lakrom | last post by:
Hi to all, how to put msgbox in this asp page, this send me a message Denied permission: 'MsgBox' <% Set Conn=server.createobject("ADODB.connection") Conn.open application("StrConRuta") set rs =...
6
by: Lapchien | last post by:
In this bit of code provided so helpfully by Nath: Private Sub Command118_Click() Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.openrecordset("IMPORT")
8
by: deko | last post by:
Can I close a MsgBox with VBA Code? Something like: If IsOpen (MsgBox, "Title") Then Close(MsgBox, "Title") Run some code Else Run other code End If Can this be done in VBA? Do I need to...
2
by: Radith Silva | last post by:
I need to use the MsgBox function like I used to in VB 6.0 So all i do is: MsgBox ("Please provide Input") BUT IN .NET: The error reads "msgbox is a namespace"
4
by: James | last post by:
What does this mean? 'To specify more than the first argument, you must use the MsgBox function in an expression' I'd love to see an example. Thanks!
9
by: Ivan Jericevich | last post by:
In my code below at the line 'response' a blip sound is heard and the program exits the sub -- No MsgBox is displayed. What am I doing wrong? If nonNumberEntered = True Then msg = "Enter...
2
by: perkykoala | last post by:
I apologize in advance for being REALLY detailed/verbose. It's the result of staring/tweaking code for too long. Using VB 2005: I need to design a multiple choice test (unfortunately, I can't...
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
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:
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,...
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
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...
0
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,...

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.