不知道为什么。它最初工作得很好,然后我对代码进行了一些更改,这些更改应该对此没有影响。
选择文件时,我所做的更改仅更改复选框的某些属性:
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)
attachmentLabel.Text = OpenFileDialog1.FileName.ToString()
attachmentCheckBox.Visible = True
attachmentCheckBox.Checked = True
End Sub
这是调用 OpenFileDialog1.ShowDialog() 的事件处理程序
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
OpenFileDialog1.Title = "Please Select a File"
OpenFileDialog1.InitialDirectory = "C:temp"
OpenFileDialog1.ShowDialog()
End Sub
任何帮助,将不胜感激。发生异常时, e 和 sender 的值会显示“无法评估表达式”。