-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.frm
143 lines (136 loc) · 4.98 KB
/
Form1.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
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "图种制作工具"
ClientHeight = 1605
ClientLeft = 45
ClientTop = 375
ClientWidth = 5040
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 1605
ScaleWidth = 5040
StartUpPosition = 3 '窗口缺省
Begin MSComDlg.CommonDialog CommonDialog1
Left = 3240
Top = 1080
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
Height = 375
Left = 120
Locked = -1 'True
TabIndex = 2
Top = 120
Width = 3615
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 375
Left = 120
Locked = -1 'True
TabIndex = 0
Top = 600
Width = 3615
End
Begin VB.Label Label3
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = " 合并文件(&G)"
ForeColor = &H80000008&
Height = 375
Left = 3720
TabIndex = 4
Top = 1080
Width = 1215
End
Begin VB.Label Label2
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = " 打开文件(&O)"
ForeColor = &H80000008&
Height = 375
Left = 3720
TabIndex = 3
Top = 120
Width = 1215
End
Begin VB.Label Label1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = " 打开图片(&P)"
ForeColor = &H80000008&
Height = 375
Left = 3720
TabIndex = 1
Top = 600
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function SetWindowPos& Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) '窗口置顶
Private Sub Form_Load()
Dim rtn
rtn = SetWindowPos(Me.hWnd, -1, 0, 0, 0, 0, 3) '窗口置顶
End Sub
Private Sub Label1_Click()
CommonDialog1.CancelError = True ' 设置“CancelError”为 True
On Error GoTo ErrHandler
CommonDialog1.Flags = cdlOFNHideReadOnly ' 设置标志
CommonDialog1.InitDir = App.Path '设置初始路径
CommonDialog1.Filter = "图像文件(*.png;*.jpg;*.jpeg;*.bmp;*.gif)|*.png;*.jpg;*.jpeg;*.bmp;*.gif" ' 设置过滤器
CommonDialog1.FilterIndex = 2 ' 指定缺省的过滤器
CommonDialog1.DialogTitle = "请选择一个图片以隐藏文件" '设置标题
CommonDialog1.ShowOpen ' 显示“打开”对话框
Text1.Text = CommonDialog1.FileName ' 显示选定文件的名字
Exit Sub
ErrHandler:
' 用户按了“取消”按钮
Exit Sub
End Sub
Private Sub Label2_Click()
CommonDialog1.CancelError = True ' 设置“CancelError”为 True
On Error GoTo ErrHandler
CommonDialog1.Flags = cdlOFNHideReadOnly ' 设置标志
CommonDialog1.InitDir = App.Path '设置初始路径
CommonDialog1.Filter = "所有文件(*.*)|*.*" ' 设置过滤器
CommonDialog1.FilterIndex = 2 ' 指定缺省的过滤器
CommonDialog1.DialogTitle = "请选择一个要被隐藏的文件" '设置标题
CommonDialog1.ShowOpen ' 显示“打开”对话框
Text2.Text = CommonDialog1.FileName ' 显示选定文件的名字
Exit Sub
ErrHandler:
' 用户按了“取消”按钮
Exit Sub
End Sub
Private Sub Label3_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "你还没有选择文件!", vbCritical, "图种制作工具"
Exit Sub
End If
CommonDialog1.CancelError = True ' 设置“CancelError”为 True
On Error GoTo ErrHandler
CommonDialog1.Flags = cdlOFNHideReadOnly ' 设置标志
CommonDialog1.Filter = "图像文件(*.png;*.jpg;*.jpeg;*.bmp;*.gif)|*.png;*.jpg;*.jpeg;*.bmp;*.gif" ' 设置过滤器
CommonDialog1.FilterIndex = 2 ' 指定缺省的过滤器
CommonDialog1.DialogTitle = "请选择图种保存的位置" '设置标题
CommonDialog1.ShowSave ' 显示“另存为”对话框
'MsgBox CommonDialog1.FileName
Shell "cmd.exe /c copy /b " & """" & Text1.Text & """" & " + " & """" & Text2.Text & """" & " " & """" & CommonDialog1.FileName & """", vbNormalNoFocus
MsgBox "已成功创建图种:" & CommonDialog1.FileName & "快分享给你的朋友吧!", 64
Exit Sub
ErrHandler:
' 用户按了“取消”按钮
Exit Sub
End Sub