Making Sure Event is Visible |
Post Reply |
Author | |
DDJJ
Senior Member Joined: 13 December 2004 Status: Offline Points: 143 |
Post Options
Thanks(0)
Posted: 12 October 2005 at 12:36pm |
We are setting up a Calendar control to give our users the option of using the control to change the times for a specific event by dragging an event, or by using the mouse to drag the start or end times of an event. The code we've been trying is shown below. Two problems. When our form opens up, the calendar control is frequently not visible. When I click on the area where the calendar control should be, it shows up, but not until then. ??? Second problem. We set up the event to be edited by the user in code (see below). This event could be at the beginning of a day or at the end, so we want the control to scroll forward to make sure the event is visible to the user. What we're doing is not working...any ideas why not? ConnectionString = "Provider=XML;Data Source=" & App.Path & "\Events.xml" CalendarControl1.ActiveView.ShowDay CDate(cbpStartDate.Text), True CalendarControl1.DataProvider.AddEvent m_oEvent CalendarControl1.Populate |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
1. First problem looks strange, but see the next point... 2. Use one more quite useful method of calendar: RedrawControl. Some methods of calendar don't redraw control automatically to avoid "blinking" during adjusting. 3. Suggestion: If you don't need to save events - You do not need these lines of code, because calendar is created by default with memory data provider. May be .DataProvider.RemoveAllEvents is usefull - depending of your form using. ConnectionString = "Provider=XML;Data Source=" & App.Path & "\Events.xml" .SetDataProvider ConnectionString If Not .DataProvider.Open Then .DataProvider.Create End If .DataProvider.RemoveAllEvents 'We don't want previously saved events .DataProvider.Save -- HTH, Serge |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |