标题: How to Create your own custom Progress/Status Meter/Bar Chart [打印本页] 作者: tmtony 时间: 2005-8-16 21:00 标题: How to Create your own custom Progress/Status Meter/Bar Chart 标题:How to Create your own custom Progress/Status Meter/Bar Chart .
You may find a need for creating a "rogress Meter" on your Form, separate from the status bar progress meter which is callable by using the sysCmd function in Access. A Progress meter can be created by using two label controls, directly on top of one another in the form. Here's how you do it:
1. Create a label control, with a sunken style, (we'll call this lblbase) and make it's back color transparent, and fore color to black.
2. Create a label control, of 0.00 width, identical in height to the lblbase (we'll call this lblmeter); align the lblmeter exactly with the left edge of the lblbase control, and send it to the back (i.e. behind the lblbase.) Make its edges transparent.
3. To update the progress meter place the following code in the form's module and send it the current and total amounts to measure progress as appropriate (you can use a timer event or place the calls in looping code etc.): Sub updatemtr (currentamt, totalamount)
' This function changes the color based on progress.
' You set the back color of lblmeter to be a single color if desired.
4. Note this same tip can also be used to create a simple horizontal bar chart on a report, and is especially handy if you don't know what the total amount might be before you run the report. (The total amount would be required to be known a priori if you were to use MS Graph to create the chart, because you would have to set the scale when creating the chart; with this method, you don't have to know the total amount before the report is run.)作者: chajiangliang 时间: 2005-8-17 06:58
标题:How to Create your own custom Progress/Status Meter/Bar Chart .