Solved

Math with textbox text

Posted on 2003-11-10
2
321 Views
Last Modified: 2010-05-03
Hi, I want to know how to do this: I write for example, "1+1" in a textbox, and when I press a button, the text turns into 2. And just like that, if I write "3+3" it says 6, if I write "6*2" it says 12... is there any way of doing that? Thanks!
0
Comment
Question by:HyMaX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
bobbit31 earned 30 total points
ID: 9718547
easiest way is to use ms script control (under project/references) then do:

Dim scr As New MSScriptControl.ScriptControl
scr.Language = "VBScript"
MsgBox scr.Eval(Text1.Text)
0
 

Author Comment

by:HyMaX
ID: 9718581
Perfect, thanks!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question