【VB开源代码栏目提醒】:以下是网学会员为您推荐的VB开源代码-main_sp.frm,希望本篇文章对您学习有所帮助。
VERSION 5.00
Begin VB.Form main_sp
BorderStyle = 3 'Fixed Dialog
Caption = "将数字格式化为金额"
ClientHeight = 1455
ClientLeft = 45
ClientTop = 330
ClientWidth = 7065
Icon = "main_sp.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1455
ScaleWidth = 7065
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 1380
Left = 0
TabIndex = 0
Top = 30
Width = 7050
Begin VB.TextBox Text1
Height = 330
Index = 1
Left = 5640
TabIndex = 6
Top = 180
Width = 1290
End
Begin VB.TextBox Text1
Height = 330
Index = 2
Left = 855
TabIndex = 5
Top = 555
Width = 2340
End
Begin VB.TextBox Text1
Height = 330
Index = 4
Left = 5640
TabIndex = 4
Top = 555
Width = 1290
End
Begin VB.TextBox Text1
Height = 330
Index = 3
Left = 3690
TabIndex = 3
Top = 555
Width = 1425
End
Begin VB.TextBox Text1
Height = 330
Index = 5
Left = 870
TabIndex = 2
Top = 900
Width = 2340
End
Begin VB.TextBox Text1
Height = 330
Index = 0
Left = 855
TabIndex = 1
Top = 180
Width = 4260
End
Begin VB.Label Label11
Caption = "品名规格"
Height = 165
Left = 75
TabIndex = 12
Top = 255
Width = 795
End
Begin VB.Label Label4
Caption = "单价"
Height = 165
Left = 3270
TabIndex = 11
Top = 630
Width = 390
End
Begin VB.Label Label3
Caption = "单位"
Height = 165
Left = 405
TabIndex = 10
Top = 630
Width = 405
End
Begin VB.Label Label6
Caption = "金额"
Height = 165
Left = 435
TabIndex = 9
Top = 1005
Width = 375
End
Begin VB.Label Label5
Caption = "数量"
Height = 165
Left = 5205
TabIndex = 8
Top = 600
Width = 405
End
Begin VB.Label Label2
Caption = "编号"
Height = 165
Left = 5205
TabIndex = 7
Top = 240
Width = 375
End
End
End
Attribute VB_Name = "main_sp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Text1_Change(Index As Integer)
If Index = 3 Or Index = 4 Then
Text1(5) = Val(Text1(3)) * Val(Text1(4))
Text1(5) = Format(Text1(5), "0.000")
End If
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Text1(Index).BackColor = &HFFFF00
Text1(Index).SelStart = 0
Text1(Index).SelLength = Len(Text1(Index))
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn And Index < 5 Then Text1(Index + 1).SetFocus
End Sub
Private Sub Text1_LostFocus(Index As Integer)
Text1(Index).BackColor = &H80000005
If Index = 3 Then Text1(3) = Format(Text1(3), "0.00")
End Sub
上一篇:
main_sjbf.frm
下一篇:
哈弗F7 VS名爵HS,谁更懂得年轻人的心?