📄 ch7.htm
字号:
<p>The simple mail client project requires two forms. The first form (<tt><font
FACE="Courier">MAPIMAIN.FRM</font></tt>) is the main form in the application. This form
will consist of a single list box that shows all the messages in the user's e-mail inbox
and a set of command buttons that can be used to perform e-mail activities such as
creating new messages, reading e-mail, deleting old messages, saving messages to text
files, and replying to existing messages. This form will also hold the MAPI controls and a
common dialog box control that will be used to save e-mail messages as text files. Refer
to Figure 7.6 when laying out the form. </p>
<p><a HREF="f7-6.gif"><b>Figure 7.6 : </b><i>Laying out the e-mail forms.</i></a> </p>
<p>Listing 7.12 shows the Visual Basic form code for <tt><font FACE="Courier">MAPIMAIN.FRM</font></tt>.
When you build the <tt><font FACE="Courier">MAPIMAIN.FRM</font></tt>, be sure to add the
picture control first; then add a single command button to the form by selecting the
command button from the toolbox and <i>drawing</i> it onto the picture control rather than
double-clicking the command button from the toolbox. By drawing it on the picture control,
you establish the command button as a child control of the picture box. Now, whenever you
move the picture box, the command button will move with it. </p>
<hr>
<blockquote>
<b><p>Listing 7.12. The <tt><font FACE="Courier">MAPIMAIN.FRM</font></tt> layout code.<br>
</b></p>
</blockquote>
<blockquote>
<tt><font FACE="Courier"><p>VERSION 4.00<br>
Begin VB.Form MapiMain<br>
Caption = "Form1"
<br>
ClientHeight = 1710 <br>
ClientLeft = 1875 <br>
ClientTop = 1725
<br>
ClientWidth = 6345 <br>
Height = 2115
<br>
Left = 1815
<br>
LinkTopic = "Form1"
<br>
ScaleHeight = 1710 <br>
ScaleWidth = 6345 <br>
Top = 1380
<br>
Width = 6465
<br>
Begin VB.ListBox List1<br>
BeginProperty Font<br>
name = "Courier"
<br>
charset = 0
<br>
weight = 400
<br>
size = 9.75
<br>
underline = 0 'False
<br>
italic = 0 'False
<br>
strikethrough = 0 'False
<br>
EndProperty<br>
Height = 840
<br>
Left = 120
<br>
TabIndex = 1
<br>
Top = 540
<br>
Width = 4695
<br>
End<br>
Begin VB.PictureBox Picture1<br>
Align = 1 'Align
Top<br>
Height = 375
<br>
Left = 0
<br>
ScaleHeight = 315
<br>
ScaleWidth = 6285
<br>
TabIndex = 0
<br>
Top = 0
<br>
Width = 6345
<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index = 9
<br>
Left = 900
<br>
TabIndex = 11
<br>
Top = 0
<br>
Width = 375
<br>
End<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index = 8
<br>
Left = 1380
<br>
TabIndex = 10
<br>
Top = 60
<br>
Width = 375
<br>
End<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index = 7
<br>
Left = 1800
<br>
TabIndex = 9
<br>
Top = 60
<br>
Width = 375
<br>
End<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index = 6
<br>
Left = 2280
<br>
TabIndex = 8
<br>
Top = 0
<br>
Width = 375
<br>
End<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index = 5
<br>
Left = 2820
<br>
TabIndex = 7
<br>
Top = 0
<br>
Width = 375
<br>
End<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index = 4
<br>
Left = 540
<br>
TabIndex = 6
<br>
Top = 0
<br>
Width = 375
<br>
End<br>
Listing 7.12. continued<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index = 3
<br>
Left = 3240
<br>
TabIndex = 5
<br>
Top = 0
<br>
Width = 375
<br>
End<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index = 2
<br>
Left = 3720
<br>
TabIndex = 4
<br>
Top = 0
<br>
Width = 375
<br>
End<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index = 1
<br>
Left = 4200
<br>
TabIndex = 3
<br>
Top = 0
<br>
Width = 375
<br>
End<br>
Begin VB.CommandButton Command1 <br>
Caption = "Command1"
<br>
Height = 315
<br>
Index
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -