我的代码有问题。我正在使用VB.NET和Visual Studio2010编写我的程序。我使用的控件的源代码可以在here中找到。
首先,我将Calendar.DayView.dll文件导入到我的工具箱中作为控件使用。然后,我将以下代码添加到现有代码中:
Private Sub DayView1_NewAppointment(ByVal sender As System.Object, ByVal args As Calendar.NewAppointmentEventArgs)
Dim appointment As New Calendar.Appointment()
appointment.StartDate = args.StartDate
appointment.EndDate = args.EndDate
appointment.Title = args.Title
appointments.Add(appointment)
End Sub我得到这个错误'Title‘不是’Calendar.Appoinment‘的成员。
我没有访问Calendar命名空间或Appointment类的权限。我可以在对象浏览器中查看两者的属性,但不能编辑它们中的任何一个。
有什么建议吗?
发布于 2010-06-09 15:01:30
我刚刚下载了源代码,并创建了一个新的windows表单应用程序,其中包含以下内容:
Private Sub DayView1_NewAppointment(ByVal sender As System.Object, ByVal args As Calendar.NewAppointmentEventArgs) Handles DayView1.NewAppointment
Dim appointment As New Calendar.Appointment
With appointment
.StartDate = args.StartDate
.EndDate = args.EndDate
.Title = args.Title
End With
End Sub它只是正常工作,一定是你的项目中有其他东西导致了这个错误,你提到的属性肯定是writable.....there,没有你定义的可能与名称Calendar.Appointment冲突的东西,对吧?
另外,你还会收到更多的错误吗?
发布于 2010-06-09 08:20:09
我现在不能看源代码,但听起来可能是权限问题。Calendar属性上的修饰符是否设置为Public?Appointment和Title也是如此。
https://stackoverflow.com/questions/3002282
复制相似问题