Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Progressbar in Statusbar in MDI

Posted on 1999-07-15
Medium Priority
Last Modified: 2013-12-25
How can I put a Progressbar in a Statusbar in a MDI-Main-Form.

If I use the code

Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

SetParent ProgressBar.hwnd, StatusBar.hwnd
ProgressBar.Top = Screen.TwipsPerPixelY
ProgressBar.Left = StatusBar.Panels(2).Left + Screen.TwipsPerPixelY
    ProgressBar.Height = StatusBar.Height - Screen.TwipsPerPixelY * 2
    ProgressBar.Width = StatusBar.Panels(2).Width - Screen.TwipsPerPixelX * 2

I can set the Left and Width property.
Is there a way to do this?
Thanks for your help.

Peter Zimmerli
Question by:Zimmerli
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

ID: 1495372
Sorry I mean I can not set the Left and Width property.
LVL 12

Expert Comment

ID: 1495373
You should be multiplying by the Screen.TwipsPerPixel instead of ADDING.

I have code to a smooth progress bar on my web page you can easily modify for this. It's in the Code Snippets section at:

Check it out!



Author Comment

ID: 1495374
I look in our Home Page. There are very good things there.
(But I don't found a solution for my problem)

If I will set the Progress bar left property I get this

Error 387 was generated by ProgramName 'Left' property can't be set on this control

I think the problem is that the Progressbar is on a MDImainForm.


Accepted Solution

przemek earned 400 total points
ID: 1495375
1) Forget about API.
2) Put PictureBox on MDIForm
Set propery Align = Bottom
3) Put StatusBar on PrictureBox
4) Put ProgressBar on PictureBox over StatusBar ( use Bring to Front ).
   Container of StatusBar and ProgressBar is PrictureBox

Or copy this to Form1.frm and add it to some project
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.MDIForm MDIForm1
   BackColor       =   &H8000000C&
   Caption         =   "MDIForm1"
   ClientHeight    =   3195
   ClientLeft      =   3930
   ClientTop       =   3255
   ClientWidth     =   6585
   LinkTopic       =   "MDIForm1"
   Begin VB.PictureBox Picture1
      Align           =   2  'Align Bottom
      BorderStyle     =   0  'None
      Height          =   615
      Left            =   0
      ScaleHeight     =   615
      ScaleWidth      =   6585
      TabIndex        =   0
      Top             =   2580
      Width           =   6585
      Begin MSComctlLib.ProgressBar ProgressBar1
         Height          =   375
         Left            =   120
         TabIndex        =   2
         Top             =   120
         Width           =   1215
         _ExtentX        =   2143
         _ExtentY        =   661
         _Version        =   393216
         Appearance      =   1
      Begin MSComctlLib.StatusBar StatusBar1
         Height          =   615
         Left            =   0
         TabIndex        =   1
         Top             =   0
         Width           =   4335
         _ExtentX        =   7646
         _ExtentY        =   1085
         _Version        =   393216
         BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
            NumPanels       =   1
            BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
Attribute VB_Name = "MDIForm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Expert Comment

ID: 6821790
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects that and the expert will now receive these points, all verified.

Please click on your Member Profile, select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.
Moderator @ Experts Exchange

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

660 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