求助:程序出现语法错误,请帮助改正,嗷嗷急!
以下的程序在Handles上出现语法错误,请高手帮助改正,谢谢. 我看到一本书上写的创建MDI窗体,先设FORM1的IsMDICondtainer为True,又建了一个窗体,ChildForm.
为了在父窗体中将一个窗体以子窗体的方式打开,需要把子窗体的MDIParent属性设置为父窗体.在FORM1中使用下列代码来显示其中的子窗体:
Public Class Form1
Private WithEvents ChildForm1 As ChildForm
Private WithEvents ChildForm2 As ChildForm
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
'显示子窗体Form1
ChildForm1 = New ChildForm()
ChildForm1.MdiParent = Me
ChildForm1.Text = "第一个子窗体"
ChildForm1.Show()
'显示子窗体Form2
ChildForm2 = New ChildForm()
ChildForm2.MdiParent = Me
ChildForm2.Text = "第二个子窗体"
ChildForm2.Show()
End Sub
End Class