-
Notifications
You must be signed in to change notification settings - Fork 2
/
frmMass.frm
146 lines (137 loc) · 4.36 KB
/
frmMass.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
VERSION 5.00
Begin VB.Form frmMass
BackColor = &H00C0FFFF&
BorderStyle = 0 'None
Caption = "质量计算器"
ClientHeight = 6240
ClientLeft = 0
ClientTop = 0
ClientWidth = 7785
Icon = "frmMass.frx":0000
LinkTopic = "Form1"
ScaleHeight = 6240
ScaleWidth = 7785
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton cmdCopy
Caption = "复制到剪切板"
Height = 495
Left = 6360
TabIndex = 3
Top = 2400
Width = 1335
End
Begin VB.TextBox texMassOut
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3135
Left = 0
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Text = "frmMass.frx":1B692
Top = 3000
Width = 7695
End
Begin VB.CommandButton cmdMass
Caption = "计算!"
Default = -1 'True
Height = 495
Left = 5400
TabIndex = 1
Top = 2400
Width = 855
End
Begin VB.TextBox texMassIn
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 495
Left = 0
TabIndex = 0
Top = 2400
Width = 5295
End
Begin VB.Image imgClose
Height = 450
Left = 7320
Picture = "frmMass.frx":1B6A9
Stretch = -1 'True
Top = 0
Width = 450
End
Begin VB.Image imgTitle
Appearance = 0 'Flat
Height = 2145
Left = 0
Picture = "frmMass.frx":1CFA1
Stretch = -1 'True
Top = 0
Width = 7815
End
End
Attribute VB_Name = "frmMass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private InTip As String
Private Sub cmdCopy_Click()
UICopy (texMassOut.Text)
End Sub
Private Sub cmdMass_Click()
Dim MassOutHtml As String
MassOutHtml = calMassPerStr(texMassIn.Text)
texMassOut = CutHtml(MassOutHtml)
HisMass = texMassIn.Text
HisMassOutput = texMassOut
Call dataBaseWrite(DataUsername, "Mass", HisMass)
Call dataBaseWrite(DataUsername, "MassOutput", HisMassOutput)
If Not DataUsername = "访客" Then
Call dataHtmlChange("historyMassOutput", CStr(MassOutHtml))
Call dataHtmlChange("historyMass", CStr(HisMass))
End If
End Sub
Private Sub Form_Load()
InTip = "请在此处输入物质化学式,例如:K4[Fe(CN)6]"
texMassIn.Text = InTip
'If HisMass <> "" Then texMassOut = calMassPerStr(HisMass)
If HisMassOutput <> "" Then texMassOut = HisMassOutput
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
ReleaseCapture
SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End Sub
Private Sub imgClose_Click()
Unload Me
End Sub
Private Sub imgTitle_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
ReleaseCapture
SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End Sub
Private Sub texMassIn_Click()
If texMassIn.Text = InTip Then
texMassIn.Text = ""
texMassIn.ForeColor = RGB(0, 0, 0)
End If
End Sub
Private Sub texMassIn_KeyPress(KeyAscii As Integer)
If texMassIn.Text = InTip Then
texMassIn.Text = ""
texMassIn.ForeColor = RGB(0, 0, 0)
End If
End Sub