① vb6.0 人民币与美元互相兑换 代码是什么
PrivateSubCommand1_Click()
Text1.Text=Val(Text3.Text)/Val(Text2.Text)
EndSub
PrivateSubCommand2_Click()
Text3.Text=Val(Text1.Text)*Val(Text2.Text)
EndSub
PrivateSubCommand3_Click()
Text3.Text=""
Text1.Text=""
Text2.Text=""
EndSub
PrivateSubCommand4_Click()
End
EndSub
② Vb的代码美元和人民币互换
窗口的控件自己制作,并设置属性。
Private Sub Command1_Click()
If Text3 <> "" Then my = Val(Text3)
If Text2 <> "" Then hl = Val(Text2)
Text1 = my * hl
End Sub
Private Sub Command2_Click()
If Text1 <> "" Then rmb = Val(Text1)
If Text2 <> "" Then hl = Val(Text2)
Text1 = rmb / hl
End Sub
Private Sub Command3_Click()
Text1 = ""
Text2 = ""
Text3 = ""
End Sub
Private Sub Command4_Click()
End
End Sub
③ 还想麻烦问一下。vb怎么实现从网络获取信息。比如:点击一个按钮“人民币美元汇率”,text框里显示6.3385
一、找汇率网站
二、用WEBBRowser控件,或其它的控件下载网页下来,分析源代码,提取到相关的信息,不过这样做比较慢,有的网站可以用POST方式得到信息的,哪种就方便多了。
④ VB编程美元兑换人民币代码
private sub command1_click()
dim m as single,r as single,h as single
m=val(text1.text) '美元数量
h=8.099 '汇率
r=m*h '换算
label1.caption=Format (r, "#.##") '显示兑换的人民币数量
end sub
⑤ 怎样用VB编写人民币与美元兑换程序
“美元到人民币”按钮的click事件代码:
my
=
val(text3)
rmb
=
my
*
val(text2)
text1
=
rmb
其中:“兑换比率”输入的是一美元兑换的人民币值
⑥ VB6.0 美元兑换人民币练习题. 代码编程
以上是初始界面,代码如下: Private Sub Command1_Click()
Text2.Text = Text1.Text * 7
End Sub
⑦ 求VB编程:货币兑换,输入人民币,兑换成美元,比例1:8.25
有的地方没说清楚
大概写了下
界面格式如下:
label1 [text1] label2 option1
option2
command1 command2 command3
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
If Option1.Value = True Then
Label1.Caption = "美元币种"
Text1.Text = 8.25 * CDbl(Text1.Text)
End If
If Option2.Value = True Then
Label1.Caption = "港币币种"
Text1.Text = 1.15 * CDbl(Text1.Text)
End If
End Sub
Private Sub Command3_Click()
Text1.SetFocus
Text1.SelLength = (Text1)
End Sub
Private Sub Form_Load()
Command1.Caption = "退出"
Command2.Caption = "兑换"
Command3.Caption = "清除"
Option1.Caption = "美元"
Option2.Caption = "港币"
Label1.Caption = "人民币兑换"
Label2.Caption = "兑换币种"
Option1.Value = True
End Sub
⑧ 用vb编写 人民币汇率
保存下面的代码到一个后缀名为FRM的文件中,再用VB打开即可。
============
VERSION 5.00
Begin VB.Form Form1
Caption = "人民币转换工具"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.OptionButton Option1
Caption = "转换成欧元"
Height = 495
Index = 3
Left = 1680
TabIndex = 4
Top = 1200
Width = 1335
End
Begin VB.OptionButton Option1
Caption = "转换成日元"
Height = 495
Index = 2
Left = 240
TabIndex = 3
Top = 1200
Width = 1215
End
Begin VB.OptionButton Option1
Caption = $"Form2.frx":0000
Height = 495
Index = 1
Left = 1680
TabIndex = 2
Top = 720
Width = 1335
End
Begin VB.OptionButton Option1
Caption = "转换成美元"
Height = 495
Index = 0
Left = 240
TabIndex = 1
Top = 720
Width = 1215
End
Begin VB.TextBox Text1
Height = 375
Left = 240
TabIndex = 0
Top = 120
Width = 1455
End
Begin VB.Label Label1
Height = 375
Left = 480
TabIndex = 5
Top = 1800
Width = 3015
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Option1_Click(Index As Integer)
Dim t As Single
t = Val(Text1.Text)
Label1.Caption = FormatNumber(Choose(Index + 1, t / 7.7, t / 15.47, t / 0.081, t / 10.8), , vbTrue)
End Sub
⑨ Vb6.0中XX美元可兑换XX元人民币要怎么编写
启动VB打开exe工程添加一个按钮输入一下代码
Private Sub Command1_Click()
On Error GoTo n
m = InputBox("请输入美元数量", "提示")
s = m * 6.2933
MsgBox m & "美元可以换" & s & "人民币", 64, "提示"
Exit Sub
n:
End Sub
⑩ vb的汇率转换
类型不匹配(错误 13)
当前 Visual Basic为了完成数据类型的赋值,能够对许多数值进行转换,而较早的版本则做不到。然而,此错误仍可能发生并且有几种原因和解决方法。
现在需要搞清楚,这个赋值式是想做字符串拼接还是是数字增加。