手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网络编程>Asp.Net编程>列表

DX: Full Screen GUI Development 2

来源:互联网 作者:西部数码 时间:2008-04-10
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

.WindowName = "MinBtn"

End With

frmMain.Window.AddChild frmMain.MinimizeButton

With frmMain.MaximizeButton

.ObjectType = MaxBtn

.ParentHeight = frmMain.Window.Height

.ParentWidth = frmMain.Window.Width

.ParentX = frmMain.Window.X

.ParentY = frmMain.Window.Y

.ObjectSurface = objDD.CreateSurfaceFromFile(App.Path & "\maximize.bmp", ddsdSurf4)

.WindowName = "MaxBtn"

End With

frmMain.Window.AddChild frmMain.MaximizeButton

With frmMain.RestoreButton

.ObjectType = RestoreBtn

.ParentHeight = frmMain.Window.Height

.ParentWidth = frmMain.Window.Width

.ParentX = frmMain.Window.X

.ParentY = frmMain.Window.Y

.ObjectSurface = objDD.CreateSurfaceFromFile(App.Path & "\restore.bmp", ddsdSurf4)

.WindowName = "RestoreBtn"

End With

frmMain.Window.AddChild frmMain.RestoreButton

This is code that used to be in the InitDD function, but has been moved out for a good reason, as you抣l see soon. It allows us to recreate the base window object and all children whenever we want. Notice also that we抳e changed the code to use the With匛ndWIth statements. It抯 saves our poor little fingers from having to type as much and speeds up the code a bit (not that it抣l be noticeable unless you timed it.

If you compare this chunk of code with the code to create the OK button, you抣l notice that we抮e not setting any X and Y or ObjectState properties for the buttons. That抯 because you can抰. The buttons only go in one place, the standard position on the window they抮e attached to. The properties are set in the ObjectSurface Property Set method:

Case MinBtn

iHeight = ddsd.lHeight / 2

iX = iParentWidth iParentX - iWidth - 40

iY = iParentY 7

iObjectState = iEnabled

Case MaxBtn

iHeight = ddsd.lHeight / 2

iX = iParentWidth iParentX - iWidth - 24

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!