iY = iParentY 7
iObjectState = iEnabled
Case CloseBtn
iHeight = ddsd.lHeight / 2
iX = iParentWidth iParentX - iWidth - 6
iY = iParentY 7
iObjectState = iEnabled
Case RestoreBtn
iHeight = ddsd.lHeight / 2
iX = iParentWidth iParentX - iWidth - 24
iY = iParentY 7
iObjectState = iEnabled
The DrawObject function is also modified to handle drawing the new controls:
Case MinBtn, MaxBtn, CloseBtn, RestoreBtn
rectObject.Left = 0
rectObject.Right = iWidth
Select Case iObjectState
Case iEnabled
rectObject.Top = 0
rectObject.Bottom = iHeight
Case iPressed
rectObject.Top = iHeight
rectObject.Bottom = iHeight * 2
End Select
If you run the app, you抣l see the new buttons in the upper right hand corner of the window. You抣l also notice that we抳e added a caption for the window. This is held by the sCaption member of the clsWindow class. If you look at the declarations section for the class you抣l also see two other new members:
Private iCaptionX As Integer
Private iCaptionY As Integer
These will be used to draw the caption where it is needed for the specific control type. If you look at the DrawObject function in the class you抣l see we抳e added the code necessary to handle the caption:
Case BaseWindow
''''Nothing needed here since we use the base rectangle
If Len(sCaption) > 0 Then
iCaptionX = iX 10
iCaptionY = iY 5
bDrawCaption = True
Else
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




