好的,目前我正在尝试根据MDI父级中的查询选择显示正确的表单,这是我获得红色下划线的位置。那个代码就是这个......
Private Sub mnLoanGpayment_Click(sender As Object, e As EventArgs) Handles mnLoanGpayment.Click, mnPayGLoan.Click, mnPayGsvtgt.Click, mnSaveGpayment.Click
'++Select case to open correct form upon selection in query.
Dim finChild As New finChild
Select Case sender.text
Case mnLoanGpayment.Text : finChild.whichChild.loanamtgivenpayment
Case mnPayGLoan.Text : finChild.whichChild.paymentgivenloanamt
Case mnPayGsvtgt.Text : finChild.whichChild.paymentgivensavetgt
Case mnSaveGpayment.Text : finChild.whichChild.savingsgivenpayment
End Select
'Set the Parent Form of the Child window.
finChild.MdiParent = Me
'Display the new form.
finChild.Show()
End Sub
目前我已经在我的finChild课程中选择了表格中的选项......
Public Class finChild
Private minamt As Decimal = 1000
Private maxamt As Decimal = 2000000
Private minpmt As Decimal = 1
Private maxpmt As Decimal = 10000
Public whichChild As Which
Public Enum Which
loanamtgivenpayment
savingsgivenpayment
paymentgivenloanamt
paymentgivensavetgt
End Enum
Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click
Dim finutl As New FinClass
End Sub
Private Sub btnReset_Click(sender As Object, e As EventArgs) Handles btnReset.Click
'++Reset form to default values and perform default math
cbMonths.Text = 36
cbRate.Text = "6.00" & "%"
txtAmount.Text = 10000
End Sub
结束班
因此,在MDI表单中,当它们位于菜单栏上的查询项目下并且他们选择要显示的表单时,它将通过切换案例然后通过finChild
中的枚举并且从那里开始,表单构建在finChild
中,用于切换案例以修改表单。但是当我尝试
Case mnLoanGpayment.Text : finChild.whichChild.loanamtgivenpayment
Case mnPayGLoan.Text : finChild.whichChild.paymentgivenloanamt
Case mnPayGsvtgt.Text : finChild.whichChild.paymentgivensavetgt
Case mnSaveGpayment.Text : finChild.whichChild.savingsgivenpayment
所有这些陈述都以红色加下划线,并带有消息Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. Expression is not a method.