将 VB6.0 代码转换为 VB.Net 代码后,出现错误“FileName”不是“System.Windows.Forms.RichTextBox”的成员。
转换后的VB6代码-
Public WithEvents rtfLicenseFile As System.Windows.Forms.RichTextBox
Private Sub cmdClose_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdClose.Click
If Not rtfLicenseFile.ReadOnly Then
rtfLicenseFile.SaveFile(rtfLicenseFile.FileName, Windows.Forms.RichTextBoxStreamType.PlainText)
System.Windows.Forms.Application.DoEvents()
Sleep(1000)
End If
Me.Close()
End Sub