在VB里怎么实现界面全屏显示(全屏时控件的大小也随之改变)?
作者:admin 日期:2008-03-18
Option Explicit
Dim ZiShiYing_T(), ZiShiYing_L(), ZiShiYing_H(), ZiShiYing_W(), ZiShiYing_N%
Private Sub Form_Load()
Dim mcontrol As Object
On Error Resume Next
ZiShiYing_N = 0
For Each mcontrol In Me.Controls
If Not (TypeOf mcontrol Is Menu) Then
ZiShiYing_N = ZiShiYing_N + 1
ReDim Preserve ZiShiYing_T(ZiShiYing_N)
ReDim Preserve ZiShiYing_L(ZiShiYing_N)
ReDim Preserve ZiShiYing_H(ZiShiYing_N)
ReDim Preserve ZiShiYing_W(ZiShiYing_N)
ZiShiYing_T(ZiShiYing_N) = mcontrol.Top / ScaleHeight
ZiShiYing_L(ZiShiYing_N) = mcontrol.Left / ScaleWidth
ZiShiYing_H(ZiShiYing_N) = mcontrol.Height / ScaleHeight
ZiShiYing_W(ZiShiYing_N) = mcontrol.Width / ScaleWidth
End If
Next
On Error GoTo 0
End Sub
Private Sub Form_Resize()
Dim mcontrol As Object
On Error Resume Next
ZiShiYing_N = 0
For Each mcontrol In Me.Controls
If Not (TypeOf mcontrol Is Menu) Then
ZiShiYing_N = ZiShiYing_N + 1
mcontrol.Top = ZiShiYing_T(ZiShiYing_N) * ScaleHeight
mcontrol.Left = ZiShiYing_L(ZiShiYing_N) * ScaleWidth
mcontrol.Height = ZiShiYing_H(ZiShiYing_N) * ScaleHeight
mcontrol.Width = ZiShiYing_W(ZiShiYing_N) * ScaleWidth
End If
Next
On Error GoTo 0
End Sub
窗体全屏显示,设置windowstat为2
Dim ZiShiYing_T(), ZiShiYing_L(), ZiShiYing_H(), ZiShiYing_W(), ZiShiYing_N%
Private Sub Form_Load()
Dim mcontrol As Object
On Error Resume Next
ZiShiYing_N = 0
For Each mcontrol In Me.Controls
If Not (TypeOf mcontrol Is Menu) Then
ZiShiYing_N = ZiShiYing_N + 1
ReDim Preserve ZiShiYing_T(ZiShiYing_N)
ReDim Preserve ZiShiYing_L(ZiShiYing_N)
ReDim Preserve ZiShiYing_H(ZiShiYing_N)
ReDim Preserve ZiShiYing_W(ZiShiYing_N)
ZiShiYing_T(ZiShiYing_N) = mcontrol.Top / ScaleHeight
ZiShiYing_L(ZiShiYing_N) = mcontrol.Left / ScaleWidth
ZiShiYing_H(ZiShiYing_N) = mcontrol.Height / ScaleHeight
ZiShiYing_W(ZiShiYing_N) = mcontrol.Width / ScaleWidth
End If
Next
On Error GoTo 0
End Sub
Private Sub Form_Resize()
Dim mcontrol As Object
On Error Resume Next
ZiShiYing_N = 0
For Each mcontrol In Me.Controls
If Not (TypeOf mcontrol Is Menu) Then
ZiShiYing_N = ZiShiYing_N + 1
mcontrol.Top = ZiShiYing_T(ZiShiYing_N) * ScaleHeight
mcontrol.Left = ZiShiYing_L(ZiShiYing_N) * ScaleWidth
mcontrol.Height = ZiShiYing_H(ZiShiYing_N) * ScaleHeight
mcontrol.Width = ZiShiYing_W(ZiShiYing_N) * ScaleWidth
End If
Next
On Error GoTo 0
End Sub
窗体全屏显示,设置windowstat为2
评论: 0 | 引用: 0 | 查看次数: 2221
发表评论
你没有权限发表留言!