473,770 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

refresh screen during scrolling

68 New Member
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 5766
FishVal
2,653 Recognized Expert Specialist
Hello, Kevin.

Try to use DoEvents command.

Regards,
Fish
Nov 12 '08 #2
Kevin Wilcox
68 New Member
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 Recognized Expert Expert
  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
Kevin Wilcox
68 New Member
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 Recognized Expert Expert
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
Kevin Wilcox
68 New Member
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 Recognized Expert Expert
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
1970
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 different windows. One of my windows involves an automatic refresh every 99 sec. The problem is that the window is coming into focus each time the refresh occurs. How can I prevent this from happening? Thank you in advance for any suggestions....
0
1624
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 different windows. One of my windows involves an automatic refresh every 99 sec. The problem is that the window is coming into focus each time the refresh occurs. How can I prevent this from happening? Thank you in advance for any suggestions....
9
4923
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 == "") { include ("InsertRecord.inc"); // Insert new record }
10
6473
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 doesn't want the whole page to be refreshed so that buttons and images around the information do not get reloaded each time. Is this really possible? Other pages on this site don't use frames, so this page can't use frams too. Creating an ActiveX...
2
1990
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 new Paint (during scrolling). But it doesn't seem to work :-( The whole screen becomes empty, and when I look into the PaintEventArgs it returns several errors (for exemple: ?petmr.Graphics.Clip -> <error: an
2
2293
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 everytime I click one of the buttons, the entire page redraws and the screen is scrolled to the top. How can I stop the entire screen from refreshing or how can I stop the page from scrolling back up to the top? Thanks in advance for your help,
1
217
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 . The problem is that when the page refresh happens the page will be left blank. My requirement is that during the page refresh the text should still be there and I should be able to
10
30694
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 to call DsStudentCourse1.Tables("SchYrSemCourseJoin").Clear() SqlDataAdapter3.Fill(DsStudentCourse1) However, the fill method causes a lot of time to process.
1
1103
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 for this as well as code for row counters for certain parts where there is a lot of looping but the information is not shown on the screen unless I stop the the program, when it displays the latest state at the point of stopping. Question: I know...
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9453
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.