How to use status bars and progress bars In ArcMap

Source: Internet
Author: User

This example shows how to use the status bar and progress bar ). After implementation, the result is that In ArcMap, the status bar is located at the bottom of it. It displays information about the current status of ArcMAP, including the progress bar. String 3

L key character string 1

Generally, you can obtain the istatusbar instance through the application instance of ArcMAP, and then obtain the iprogressbar instance through statusbar through GIS, and assign the iprogressbar instance to the istepprogressor type variable. String 4

L program description

String 3

 

Run the function showprogress to add a status bar (statusbar) and a progress bar (progressbar) to the GPS at the bottom of ArcMap ). String 8

L code

String 8

 

Sub showprogress ()
On Error goto err1
Dim pdocument as imxdocument
Dim pmap as IMAP
Dim player as ilayer
Dim pfeaturelayer as ifeaturelayer
Dim pfeaturecursor as ifeaturecursor
Dim pfeatureclass as ifeatureclass
Dim pfeature as ifeature
Dim dsum as double
Dim lfieldindex as long
Dim lnumfeat as long
Dim dinterval as double
Set pdocument = application. Document
Set pmap = pdocument. focusmap
Set player = pmap. layer (0)
Set pfeaturelayer = player

String 7

Set pfeatureclass = pfeaturelayer. featureclass
Set pfeaturecursor = pfeaturelayer. Search (nothing, true)
Dim pstatusbar as istatusbar
Set pstatusbar = application. statusbar
Dim pstepprogressor as istepprogressor
Set pstepprogressor = pstatusbar. progressbar
Lnumfeat = pfeatureclass. featurecount (nothing)
Dinterval = lnumfeat/100
Set pfeature = pfeaturecursor. nextfeature
The 'field name "FID" user changes according to the actual situation
Lfieldindex = pfeature. Fields. findfield ("FID ")
Dim pausetime, start, finish, totaltime, I
Pausetime= 0.5
Pstepprogressor. minrange = 1
Pstepprogressor. maxrange = lnumfeat

String 5

Pstepprogressor. stepvalue = dinterval
For I = 1 to lnumfeat
Dsum = dsum + pfeature. Value (lfieldindex)
Set pfeature = nothing
Set pfeature = pfeaturecursor. nextfeature
Pstepprogressor. Position = I
Pstepprogressor. Message = "reading record" & STR (I) & ". Sum =" & STR (dsum)
Pstepprogressor. Step
Pstepprogressor. Show
Start = Timer
Do While timer <start + pausetime
Doevents
Loop string 3
Next
Pstepprogressor. Hide
Exit sub
Err1:
Msgbox err. Description
End sub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.