① 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為了完成數據類型的賦值,能夠對許多數值進行轉換,而較早的版本則做不到。然而,此錯誤仍可能發生並且有幾種原因和解決方法。
現在需要搞清楚,這個賦值式是想做字元串拼接還是是數字增加。