Can we display only integers / numbers through the message
box? Is there any constraint to do so?
Answers were Sorted based on User's Feedback
Answer / mirza arif nadeem
yes we can display only the integers through the message box.
if isnumeric(<value>) then
msgbox value
end if
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / vijju
we can display any thing in messagebox. but, what we r
going to display can be converted into string.
ex:messagebox.show(xxxx.tostring());
| Is This Answer Correct ? | 6 Yes | 5 No |
Answer / sachin
Message box can display both integer and string like we can
give
Msgbox 5
Msgbox "5". But really there is an issue with VB's message
box for the length. It can only display limited text. What
I mean is
If we concatenate a string to a very large string in a loop
(for eg selected items in a listview,grid etc) then if we
put this string in a message box like
msgbox strSelection . Then you will notice that half of
your string will be missing. So same will happen with
number but it doesn't make sense we ever having a large
number like that !
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / abhishek saurabh
Dim value As Integer
value = 10
MessageBox.Show(value)
| Is This Answer Correct ? | 1 Yes | 2 No |
yes, we can display only integers/numbers through the
message box. following is the code.
'code starts here
'declaring variable which holds integer number.
dim intA as integer
'declaring variable which holds string value
dim strB as string
'now, if we have textbox control in which we enter the
value of any number which may or may not be integer.
intA=cint(val(text1.text))'text1 is name of textbox
control.
strB= cstr(intA)
msgbox strB,vbokonly,"here is integer number"
'code ends here.
paste this code in command1_click event in the form which
contains textbox control text1 and commandbutton control
command1.run the program. enter any number in textbox,
click command1 and see the result in message box. thanks.
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / laxmi
dim xx as integer
xx=123
if val(xx) then exit sub
| Is This Answer Correct ? | 1 Yes | 5 No |
What is the different between Microsoft ODBC Driver and Oracle OBDC Driver?
what are the three main differences between flexgrid control and dbgrid(Data bound Grid) control
Explain the working with task in Gantt chart view.
What are the objects in ADODB?
what is Type Library and what it's purpose?
What is the difference Between ADO and other data access objects?
What is the purpose of the ClipControls property on a form or container?
Is it possible to call backend procedures with ADO control?
It possible to call OLEDB's Features directly in VB without using any control?
How will you retain the values of existing elements in a dynamic array when you want to alter the array size?
___,___ and __ are difference between image and picture controls.
How would you run your ActiveX Document Dll?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)