![]()  | 
 
Scroll hor. to a given day | 
 
    Post Reply  
   | 
  
| Author | |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: Scroll hor. to a given dayPosted: 09 January 2008 at 11:26am  | 
 
| 
   
    
   Hello
 
   
  is it possible to scroll programmatically to a given day in day view that is outside the actual view (like with the scrollbar manually)? 
thanks in advance 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   sserge  
   
   Moderator Group  
   Joined: 01 December 2004 Status: Offline Points: 1297  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 09 January 2008 at 1:56pm | 
 
   
   
 -- WBR, Serge  | 
 |
![]()  | 
 |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 10 January 2008 at 8:28am | 
 
| 
   
    
   Hello Serge
 
   
  thanks for your reply. But that is not exactly what I am searching for but it is the first part of the story: 
With .Showdays I can direct a dayview to show days from - let me say - Jan. 7 to Jan 18. But now the second part: because the for instance the 16.  is not shown on screen I should move the dayview horizontally so that the the 16. was shown but the user shoud be still able to move back with the scroll bar to the 7... 
Any idea? Thanks 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 17 January 2008 at 1:42am | 
 
| 
   
    
   Hi all
 
   
  Really no solution for this... 
Thanks in advance 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 31 January 2008 at 11:08am | 
 
| 
   
    
   Is this really not possible???
    
   
   | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 19 February 2008 at 11:28am | 
 
| 
   
    
   I should have a method like:
 
   
  dayView.EnsureVisibleDay(d as Date) 
Eventually possible for V12? 
Thanks in advance 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 23 March 2008 at 6:22am | 
 
| 
   
    
   As I checked feature list for v12, there is still no possibility to move the calendar in day view to a given day? Simply missing in list or missing feature. If anybody has som time please implement this method!!! 
 
   
  Thanks 
Fabian 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   dentor  
   
   Senior Member  
   Joined: 30 November 2005 Location: France Status: Offline Points: 102  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 23 March 2008 at 11:10am | 
 
| 
   
    Hello, 
You can test this subroutine to do the job: 
Sub GotoDate(Dt As Date) 
Dim ViewTp As CalendarViewType Screen.MousePointer = vbHourglass With Calendar     ViewTp = .ViewType 
    LockWindowUpdate .hwnd 
Select Case ViewTp Case xtpCalendarMonthView .MonthView.ShowDay Dt, True Case xtpCalendarDayView .DayView.ShowDay Dt, True Case xtpCalendarWorkWeekView .DayView.ShowDay Dt, True .ViewType = ViewTp Case xtpCalendarWeekView .WeekView.ShowDay Dt, True End Select LockWindowUpdate 0 Screen.MousePointer = vbDefault End Sub I use LockWindowUpdate Api to prevent flickering, in CalendarWorkWeelView Mode, so we must put the declaration line below in the beginning of the code:  
Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long 
I hope that it is what you are looking for. 
 | 
 |
![]()  | 
 |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 23 March 2008 at 12:11pm | 
 
| 
   
    
   Hi Dentor
 
   
  thanks for thinking about this problem but your idea doesn't work as I expect. I must show e.g. 10 days in dayview but only 4 are visible. So it should be possible to scroll programmatically to day 6, like a method CalendarControl.EnsureVisible(d as Date). 
thanks again 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   jpbro  
   
   Senior Member  
   Joined: 12 January 2007 Status: Offline Points: 1357  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 23 March 2008 at 12:43pm | 
 
| 
   
    
   Hi Fabian, 
   
  Can you explain how you've set up your calendar in a bit more detail? I've tried using Me.CalendarControl1.DayView.ShowDays "Jan 7, 2008", "Jan 18, 2008" and it shows every day from Jan 7 to Jan 18, no scrolling required (when in DayView). You mention that your view doesn't show Jan 16, so I'm wondering how you have your control set up.  | 
 |
![]()  | 
 |
   
   dentor  
   
   Senior Member  
   Joined: 30 November 2005 Location: France Status: Offline Points: 102  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 23 March 2008 at 1:23pm | 
 
| 
   
    
   Ok, I see.
 
   
  Just another subroutine that can do the trick: 
Sub EnsureVisibleDate(Dt As Date) 
Dim LastDay As Long With Calendar ' *** How many days in Dayview LastDay = .DayView.DaysCount - 1 ' *** Date below or above dayview If Dt < .DayView(0).Date Then .DayView.ShowDays Dt, Dt + LastDay ElseIf Dt > .DayView(LastDay).Date Then .DayView.ShowDays Dt - LastDay, Dt End If End With End Sub  | 
 |
![]()  | 
 |
   
   jpbro  
   
   Senior Member  
   Joined: 12 January 2007 Status: Offline Points: 1357  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 23 March 2008 at 2:14pm | 
 
| 
   
    
   
Hi Fabian, 
   
  I've re-examined your posts, and I *think* I understand what you want to do: 1) Only allow the user to scroll over a range of dates (for example, 10 days from today) 2) Only show the user a subset of those dates (for example, 4 days on-screen at once) in DayView I've put together a sample that can fulfil those requirements. The form requires a Codejock ScrollBar control (ScrollBar1) and a Codejock CalendarControl (CalendarControl1). It may be buggy since I haven't tested it extensively, but it should illustrate the principles: 
  | 
 |
![]()  | 
 |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 24 March 2008 at 4:27am | 
 
| 
   
    
   Thanks for your effort
 
   
  But my problem can not been solved with the current version, so I cried for a new method: 
I use 
DayView.EnableHScroll 
DayView.ShowDays(Date1, Date2) 
Because I allow hor. scrolling, not all days are shown in my window. The user can scroll horizontally to view all events of all days. But I have built in a search function, that finds the next free time. If this time was outside the actual shown days I will .EnsureVisible(Date): 
                            ¦ Window border 
                            ¦ 
|Day1|Day2|Day3|Day4|day5 
                            ¦ 
Day1 to 3 are visible but I wish to scroll so e.g. day1 vanishes and day4 was shown. 
hope this clarifies my problem and I hope CJ has an ear for me 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   dentor  
   
   Senior Member  
   Joined: 30 November 2005 Location: France Status: Offline Points: 102  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 24 March 2008 at 4:51am | 
 
| 
   
    
   Hello Fabian,
 
   
  Did you test the EnsureVisibleDate subroutine showed above. I think it make a response for your problem to show the date in the calendar after your search routine. 
 | 
 |
![]()  | 
 |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 24 March 2008 at 5:45am | 
 
| 
   
    
   Hello Dentor
 
   
  Yes your code goes in the right direction. But because we have no indication if a day is visible or not I always scroll the given day around. So what I expect from CJ is a simple method .EnsureVisibleDate(Date) (like the allready present method .EnsureVisible(Viewevent)). It sould move the day into view if necessary. 
Thanks a lot for your help 
    | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   dentor  
   
   Senior Member  
   Joined: 30 November 2005 Location: France Status: Offline Points: 102  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 24 March 2008 at 6:05am | 
 
| 
   
    
   Hello Fabian,
 
   
  If you watch the code, you'll see that if the day is visible, the subroutine do nothing. 
I agree with you, it will be better if CJ make an intrinsec method EnsureVisible to do the job. Meanwhile, I think it's a good workaround. 
![]()  | 
 |
![]()  | 
 |
   
   Fabian  
   
   Senior Member  
   Joined: 22 November 2004 Location: Switzerland Status: Offline Points: 336  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 24 March 2008 at 9:16am | 
 
| 
   
    
   Hi dentor 
 
   
  I am not shure if you are rigth. How do you know how much days are visible?  
I enable horizontal scrolling with .EnableHScroll True and I thought DaysCount returns the total number of days in a day view not only the visible ones... 
Am I wrong??? 
 | 
 |
| 
   
     
     Product: Xtreme SuitePro (ActiveX) version 16.2.3  
   
  Platform: Windows 7 (32bit) Language: Visual Basic 6.0 / SP6  | 
 |
![]()  | 
 |
   
   dentor  
   
   Senior Member  
   Joined: 30 November 2005 Location: France Status: Offline Points: 102  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 24 March 2008 at 9:42am | 
 
| 
   
    Apparently, the Dayview.Daycount return only the number of visible days (not the invisible days), even if Dayview.EnableHscroll is turn to True. 
So we can know how many days are visible. 
Did you try the code? 
 | 
 |
![]()  | 
 |
   
   jpbro  
   
   Senior Member  
   Joined: 12 January 2007 Status: Offline Points: 1357  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 24 March 2008 at 12:36pm | 
 
| 
   
    
   Just out of curiosity, how do you show the horizontal scrollbar? When I use this code: 
   
  
 It shows all 10 days squished into the view with no horizontal scrollbar. On my computer EnableHScroll only seems to apply to horizontal scrolling using the keyboard. Is there another setting requried to show the horizontal scrollbar?  | 
 |
![]()  | 
 |
    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  |