gpt4 book ai didi

vb.net - 表格未定义 VB.NET

转载 作者:行者123 更新时间:2023-12-04 18:22:51 27 4
gpt4 key购买 nike

我正在尝试将表单对象存储到变量中,但没有成功:

此代码不起作用:

Dim invoice_form As billing_new_invoice

'Get last remote Row
Dim last_row As Integer = CType(main.ActiveMdiChild, invoice_form).invoiceitems_new_invoice.Rows.Count - 1

Dim count_row As Integer = CType(main.ActiveMdiChild, invoice_form).invoiceitems_new_invoice.Rows.Count()

此代码有效:
Dim invoice_form As billing_new_invoice

'Get last remote Row
Dim last_row As Integer = CType(main.ActiveMdiChild, billing_new_invoice).invoiceitems_new_invoice.Rows.Count - 1

Dim count_row As Integer = CType(main.ActiveMdiChild, billing_new_invoice).invoiceitems_new_invoice.Rows.Count()

Error

我需要将表单实例存储在变量(invoice_form)中,该变量可以在多行代码中使用,但它说(未定义类型'invoice_form'。)
有人有想法解决这个问题吗?

最佳答案

不是很清楚是什么问题。我想你正在寻找这样的东西:

If TypeOf Me.ActiveMdiChild Is billing_new_invoice Then
Dim invoice_Form As billing_new_invoice = Me.ActiveMdiChild

Dim last_row As Integer = invoice_form.invoiceitems_new_invoice.Rows.Count - 1
Dim count_row As Integer = invoice_form.invoiceitems_new_invoice.Rows.Count()

//'etc

End If

代码不起作用的问题是它试图将其转换为变量,而不是类型。 invoice_form是一个变量, billing_new_invoice是一种类型。

关于vb.net - 表格未定义 VB.NET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10302731/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com