Can we display only integers / numbers through the message
box? Is there any constraint to do so?

Answer Posted / hemal1972

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of line styles available in Treeview Control?

1664


How can you filter out specific type of file using file system controls?

1606


what are the Differences between Recordset and Resultsets?

2281


What is hyperlink?

1825


What is recordset in visual basic?

772


VB ActiveX: Create a "drivelist"(D1) box, a "folderlistbox"(FLD1) that changes whenever D1 is changed , and a "FilelistBox"(FIL1) that is populated with the file lists under the selected directory in (D1).The file selected is stored in a variable "filename" along with the path. Question: How to use this activeX control in VC++ to get the selected filename?

1755


What can you do with visual basic?

777


How can you force new objects to be created on new threads?

2085


How many objects resides in ADO ?

1697


What are the Internet tools available in VB 6.0?

2600


What is ado data control in vb?

736


___ Property is used to count no. of items in a combobox.

1155


Is it possible to change menu runtime using API? If yes? Specify the function names.

1777


What is activex control in vb?

746


i want to retrive data from one spead sheet to another UI (workbook). control will search cell by cell for each row and load the data in another workbook(UI).

2019