VB
Microsoft 开发的一种面向对象的编程语言,其在 .NET Framework 上实现。 以前称为 Visual Basic .NET。
83 个问题
Public Sub AddPrintBook() Select Case ShoppingCart.lstCart.Items.Add(lstPrintBooks.SelectedIndex) '"""""Getting a NULL error here. """""Copy
Case 0
strSelectedBook = strYourWay
decSubTotal += decYourWay
decShippingTotal += decShippingTotal
Case 1
strSelectedBook = strHistoryScotland
decSubTotal += decHistoryScotland
decShippingTotal += decShippingTotal
Case 2
strSelectedBook += decCalculus
decSubTotal += decHistoryScotland
decShippingTotal += decShippingTotal
Case 3
strSelectedBook = strRelax
decSubTotal += decRelax
decShippingTotal += decShippingTotal
End Select
End Sub
Note:此问题总结整理于:Help with NULL error, when trying to add from a form, a list, to another form and list.
请看下面的例子: 我在 form1 上有 listbox1,在 form2 上有 listbox1。 表格 1:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim frm2 As Form2 = New Form2(Me)
frm2.Show()
End Sub
End Class
表格2:
Public Class Form2
Private ReadOnly frm1 As Form1
Public Sub New(ByVal form1 As Form1)
frm1 = form1
InitializeComponent()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
ListBox1.Items.Add(frm1.ListBox1.SelectedIndex)
End Sub
End Class
如果答案是正确的,请点击“接受答案”并点赞。 如果您对此答案还有其他疑问,请点击“评论”。
注意:如果您想接收相关电子邮件,请按照我们的文档中的步骤启用电子邮件通知 此线程的通知。