vb.net打开计算器 计算器代码VB

VB.NET怎么编模拟袖珍计算器的完整程序?

Public C护激篙刻蕻灸戈熏恭抹lass Form1

创新互联主打移动网站、网站设计、做网站、网站改版、网络推广、网站维护、域名与空间、等互联网信息服务,为各行业提供服务。在技术实力的保障下,我们为客户承诺稳定,放心的服务,根据网站的内容与功能再决定采用什么样的设计。最后,要实现符合网站需求的内容、功能与设计,我们还会规划稳定安全的技术方案做保障。

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim c As Char

c = Trim(TextBox3.Text)

Select Case c

Case "+"

TextBox4.Text = Val(TextBox1.Text) + Val(TextBox2.Text)

Case "-"

TextBox4.Text = Val(TextBox1.Text) - Val(TextBox2.Text)

Case "*"

TextBox4.Text = Val(TextBox1.Text) * Val(TextBox2.Text)

Case "\"

If Val(TextBox2.Text) = 0 Then

MsgBox("分母为0")

Else

TextBox4.Text = Val(TextBox1.Text) \ Val(TextBox2.Text)

End If

Case "/"

If Val(TextBox2.Text) = 0 Then

MsgBox("分母为0")

Else

TextBox4.Text = Val(TextBox1.Text) / Val(TextBox2.Text)

End If

End Select

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

End

End Sub

End Class

vb.net中 我们都知道 shell函数可以打开 *.exe文件 比如说打开系统自带的 计算器

这个不属于VB的问题,而是操作系统使用问题。

以计算器为例:点开始,程序,附件。

看到计算器,用鼠标右健单击,点 属性 ,点 快捷方式,你就看到了。

怎样在VB .NET中调用记事本和计算器

这个啊,呵呵,应该不难吧

先找到你要打开的应用程序的文件

然后用一个调用代码:

System.Diagnostics.Process.Start("C:\WINDOWS\system32\notepad.exe")

这是要开记事本的

System.Diagnostics.Process.Start("C:\WINDOWS\system32\calc.exe")

这是打开计算器的

应该也可以把这两个应用程序复制到你的程序的默认目录下,就是BIN下吧!

呵呵,试试!!要给我加分哦!!!


网站标题:vb.net打开计算器 计算器代码VB
URL网址:http://myzitong.com/article/hjedsi.html