开发者

VB.NET - 'Title' is not a member of 'Calendar.Appointment'

开发者 https://www.devze.com 2023-01-02 14:48 出处:网络
I am having a problem with my code. I am using VB.NET and Visual Studio 2010 to write my program. The source of the control that I am using can be found here.

I am having a problem with my code. I am using VB.NET and Visual Studio 2010 to write my program. The source of the control that I am using can be found here.

First, I imported the Calendar.DayView.dll file into my tool开发者_开发技巧box to use as a control. Then I added the following code to my existing code:

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

I get this error 'Title' is not a member of 'Calendar.Appointment'.

I have no access to the Calendar namespace or the Appointment class. I am able to view the properties of both in the Object Browser but I can't edit any of them.

Any suggestions?


I have just downloaded the source code and created a new windows form app with this in it:

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

It just works, there must be something else in your project causing this error, the properties you mentioned are definitely writable.....there is nothing you have defined that could be conflicting with the name Calendar.Appointment is there?

Also are you getting any more errors?


I can't look at the source code right now, but it sounds like it might be a permissions issue. Is the modifier on the property for Calendar set to Public? Same for Appointment and Title.

0

精彩评论

暂无评论...
验证码 换一张
取 消