代码VB6通过调试,不知道的版本? Private Sub MDIForm_Load() Picture1.Appearance = 0 Picture1.BackColor = Me.BackColor Picture1.Height = Me.Height End SubPrivate Sub MDIForm_Resize() Picture1.Height = Me.Height End Sub
LZ:你的担忧不存在,完全可由代码控制: Option Explicit Dim xsFlag As BooleanPrivate Sub MDIForm_Load() Picture1.Appearance = 0 Picture1.BackColor = Me.BackColor Picture1.Height = Me.Height End SubPrivate Sub MDIForm_Resize() Picture1.Height = Me.Height End SubPrivate Sub xs_Click() If xsFlag Then '隐藏子窗体 Me.Picture1.Visible = True Form1.Visible = False Else '显示子窗体 Me.Picture1.Visible = False Form1.Show End If xsFlag = Not xsFlag End Sub
思维定式 为什么一定要mdiform上放控件呢?用一个子窗口不就行了? Private Sub MDIForm_resize() Load Form1 Form1.BorderStyle = 0 With Form1 .Left = Me.ScaleWidth - Form1.Width .Top = Me.ScaleHeight - Form1.Height End With End Sub
Private Sub MDIForm_Load()
Picture1.Appearance = 0
Picture1.BackColor = Me.BackColor
Picture1.Height = Me.Height
End SubPrivate Sub MDIForm_Resize()
Picture1.Height = Me.Height
Picture1.Height = Me.Height
这步报错, 不能在该控件中设置Height属性!,
Private Sub MDIForm_Load()
Picture1.Appearance = 0
Picture1.BackColor = Me.BackColor
Picture1.Height = Me.Height
End SubPrivate Sub MDIForm_Resize()
Picture1.Height = Me.Height
End Sub
Option Explicit
Dim xsFlag As BooleanPrivate Sub MDIForm_Load()
Picture1.Appearance = 0
Picture1.BackColor = Me.BackColor
Picture1.Height = Me.Height
End SubPrivate Sub MDIForm_Resize()
Picture1.Height = Me.Height
End SubPrivate Sub xs_Click()
If xsFlag Then '隐藏子窗体
Me.Picture1.Visible = True
Form1.Visible = False
Else
'显示子窗体
Me.Picture1.Visible = False
Form1.Show
End If
xsFlag = Not xsFlag
End Sub
没有方法就找投机取巧
我要实现的是 ,用这个控件显示系统消息,点消息后 ,弹出消息处理界面,这个时候,消息框还是要显示出来的,
不过还是非常感谢zdingyun
我看是不是只能用第三方控件或单独MDI子窗体来实现这个目的了,但单独MDI子窗体,我有需要将它始终固定在一个位置,并且不能被覆盖,诶,还有办法吗?
为什么一定要mdiform上放控件呢?用一个子窗口不就行了?
Private Sub MDIForm_resize()
Load Form1
Form1.BorderStyle = 0
With Form1
.Left = Me.ScaleWidth - Form1.Width
.Top = Me.ScaleHeight - Form1.Height
End With
End Sub