Solved

Controls - Status Bar

Posted on 2002-06-13
10
174 Views
Last Modified: 2010-05-02
What control should i use.

My vb application takes a while to do some processing so i want to let the user know that the application is busy doing something. Any ideas whatr control to use and how to use it on the form ?????
0
Comment
Question by:marksynnott
10 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7075165
There exists a "Status Bar" control:
simply check the following for your Project Components:
"Microsoft Windows Common Controls x.0"

CHeers
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7075166
... now, when you set the simpletext value, don't forget to use the DOEVENTS function to allow the text to be drawn...

CHeers
0
 

Expert Comment

by:fesar
ID: 7075179
Hi,

   You can also use the progress bar. First set a maximum value.

Like

 Progressbar.Max = 1000
 I = 0

 Within the loop you can mention like
 
 ProgressBar.Value = I;
 I = I +1;

 This will be more usefull if you are reading a file. Just get the max no of records of the file and give it as the maximum value for the ProgressBar.

 Like ProgressBar.Max = No of records.

 Whenever you read one record. increment the value of
I=0
Do EOF()
   ProgressBar.Value = I
   I = I + 1
End Loop

So this will give you a transfer progree until your task is completed.
0
 
LVL 4

Expert Comment

by:gencross
ID: 7075231
I always like to use a combination of the statusbar and progress bar.

For example the way Internet Explore uses the statusbar and then a type of progress bar in a panel of the statusbar to calculate page timeout.  

You can do this by placing the progressbar over top of the statusbar to fit in whatever panel you want.

Hope this helps
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7075281
The most important thing, is to see that the user does not click any thing on the form when some processing is 'ON'

This can be taken care by setting the

1)Form.Enabled=False

2)PLUS showing the mouse icon as 'Hour-glass'(change it back to the default after the process).

This will surely make the user aware that some process is going on and therefore wont allow the user to click on the an buttons on the form.

The progress bar and status added to the above code will make the application more professional.

I hope this info helps

-priya
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Expert Comment

by:priya_pbk
ID: 7075283
dont forget to do this after the process..

Form1.Enabled=True

0
 

Author Comment

by:marksynnott
ID: 7075337
Thanks

I have found the status bar control - how do i make it do things........
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 50 total points
ID: 7075346
Either you set the Style
* to 0 - sbrNormal and use the .Panels(x).Text property to display data, or
* to 1 - sbrSimple, and use the .SimpleText value to display text.

To put the progressbar "into" it, you have to move the progressbar to the place, and whenever the form resizes move it where needed. In fact, you take 1 panel of the Panels where you use the .Left, .Top etc properties to move the progress bar as needed.

CHeers
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7075364
Drag and Drop the status bar on your form.  By default it will be placed at the bottom of the form.

Then in the code you can change the text like this

Private Sub Command1_Click()
StatusBar1.Panels(1) = "This will take some time...Pls Wait"
frm1.MousePointer=11
'..some of your code goes here, ie opening your recordset
'opening IE or web browser..etc
StatusBar1.Panels(1)="Processing...."
'..some more code goes here..
'StatusBar1.Panels(1)="Done"
frm1.MousePointer=0
End Sub

Also as i suggested , maked the form inactive and the mousePointer=hourglass

-priya
0
 
LVL 2

Expert Comment

by:priya_pbk
ID: 7075373
also, you can add more Panels on your status bar. This can be done at design time. Go the the status bar properties and Custom properties, Panels tab, Isert Panels to insert more than the Panels you require.

Change the caption of the Panel at runtime, in your code

-priya
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now