473,386 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

refresh screen during scrolling

Hi

I'm trying to emulate, within access, the gantt chart timeline / task planner aspects of ms project. Creating the chart on the form has been easy enough; I use a series of unbound text boxes in the header to show the week numbers, with correlating unbound text boxes in the detail section of a continuous form to calculate a series of values for each task which, where these match the value in the header text box will change the colour of the detail box using conditional formatting.

The planner only shows 3 months worth of project time on the form, so to make it 'dynamic' i.e. can span 2 or 3 years worth of project life, I use an activex scroll bar control to set the week number of the first week in the first text box, then the other 12 text boxes (weeks in the displayed quarter) calculate off that.

All of this is slightly besides the point but it might help you understand what it is I'm trying to acheive;

my problem is that I would like all the text boxes to recalculate and/or get a screen refresh on each incremental change when I hold down the scroll bar buttons, i.e. to scroll. This would mean that the form would then look and work exactly like project. At the moment it'll refresh once I stop scrolling, but not during the scroll. however, the value in the first text box, which is set by the scroll bar, does update during scrolling so I'm sure this must be possible. I've tried playing around with the various events of the scroll bar and the text boxes but this doesn't get me anywhere.

It feels like I'm either missing something obvious or going down a blind alley, i.e. I could acheive this quite easily through using a different control or approach. Does anyone have any ideas?

Thanks
Kevin
Nov 12 '08 #1
7 5710
FishVal
2,653 Expert 2GB
Hello, Kevin.

Try to use DoEvents command.

Regards,
Fish
Nov 12 '08 #2
Hi Fishval

that doesn't seem to work. can I check that I'm coding this right?

Expand|Select|Wrap|Line Numbers
  1. Private Sub ScrollBar1_Change()
  2. On Error GoTo proc_error
  3. Dim ScrollVal As Integer
  4. Dim DateFactor As Integer
  5.  
  6. ScrollVal = Int(Me.ScrollBar1.Value)
  7.  
  8. Select Case ScrollVal
  9. Case 52
  10. DateFactor = 0
  11. Me.txtWk1 = RefDate
  12. Case Is < 52
  13. DateFactor = (52 - ScrollVal) * 7
  14. Me.txtWk1 = RefDate - DateFactor
  15. Case Is > 52
  16. DateFactor = (ScrollVal - 52) * 7
  17. Me.txtWk1 = RefDate + DateFactor
  18. End Select
  19. Me.Repaint
  20. DoEvents
  21.  
  22. proc_error:
  23. GoTo proc_exit
  24.  
  25. proc_exit:
  26. Exit Sub
  27.  
  28. End Sub
It actually doesn't make any difference whether I use refresh or repaint, or whether this is before or after doevents. If you're certain that doevents is the solution I'll persist.

thanks
Kevin
Nov 13 '08 #3
ADezii
8,834 Expert 8TB
  1. I'm a little rusty on the ScrollBar Control, but if you a User to be able to see the changes in the Value Property while dragging the Button, you need to place code in the Scroll() Event.
  2. Consequently, I would imagine that if you wanted the Screen Display to 'catch up', you would place the DoEvents Statement here.
  3. If the difference between the Min and Max values is large, you may wish to execute DoEvents at periodic Intervals, such as:
    Expand|Select|Wrap|Line Numbers
    1. Private ScrollBarName_Scroll(<not sure of Argument(s)>)
    2. Static lngCounter As Long
    3.  
    4. lngCounter = lngCounter + 1
    5.  
    6. If lngCounter Mod 1000 = 0 Then
    7.   DoEvents
    8. End If
    9. End Sub
  4. Take all this with a grain of salt, since I haven't programmed Scroll Bars in awhile, but do let us know how you make out.
Nov 13 '08 #4
Sadly that doesn't work either. Refreshing does have an effect in so far that the screen will flicker as the value changes, but at best the screen will white-out within the affected area the repaint once I release the mouse button. I'm wondering whether I might be able to solve it by using a mousedown event on the form coupled with timer and an on_click on a dummy button. I don't know enough about scroll bars to know what I should be able to get them to do but it feels like the mousedown situation interferes with any attempt to interrupt the looping which must be taking place.

Thanks
Kevin
Nov 13 '08 #5
ADezii
8,834 Expert 8TB
Not sure what the problem is, if I send you my E-Mail Address in a Private Message, would you be willing to send me the DB so that I may have a look at it first hand?
Nov 13 '08 #6
that's very kind of you, yes of course. do you need my private email address?

thanks
Kevin
Nov 13 '08 #7
ADezii
8,834 Expert 8TB
do you need my private email address?
No, I'll obtain it when you E-Mail me the Database as an Attachment. I'll send you a Private Message shortly with the Address.
Nov 13 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bilal | last post by:
Hi, I'm a complete beginner in Javascript and php ... so forgive me for asking an easy/simple solution to the following problem: I'm developing an application that involves multi-screen in...
0
by: Bilal | last post by:
Hi, I'm a complete beginner in Javascript and php ... so forgive me for asking an easy/simple solution to the following problem: I'm developing an application that involves multi-screen in...
9
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST ==...
10
by: Conax | last post by:
Hi there, My boss is hoping that I can come up with a page that displays some information. The information will always be displayed on specific part of the page, with auto refresh. But he...
2
by: DraguVaso | last post by:
Hi, To get faster performance of my DataGrid during scrolling I wanted to build a timer in the Paint-event that waited some milli-seconds to Paint and cancelled the method in case it received a...
2
by: Kevin Chandler | last post by:
I appologize in advance if this is a novice question. I don't have much ASP.Net experience. I have an NCAA tournment selection page that I use asp:button controls. The problem is that...
1
by: pavanp | last post by:
Hi All, I am having a aspx page developed in C# it contains a marquee with some text scrolling. After looping this text for ten time say I am refreshing the page for updating the scrolling text...
10
by: jaYPee | last post by:
I have a function that call a stored procedure which performs an insert command. now i want to refresh the dataset so that the newly inserted data will be available to my datagrid I have tried...
1
by: dicky | last post by:
I am writing a script to compare a number of documents. During the course of the program I would like to to have a Status list box showing the point at which the progam is at. I have written the code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.