API Status Bar - Mike?
- From: "WebBiz" <justask@xxxxxxxxxxxxxxxxx>
- Date: Mon, 20 Feb 2006 13:15:29 -0600
One of my project testers came back to report this problem. It's a dousey.
When my application opens, it resizes the picturebox to the form in
maximized size, then it draws a status bar using API.
Private Sub Form_Resize()
Dim r As Long
Dim bRedrawFlag As Boolean
Dim iSBDivisions As Integer
If gLastWindowState = vbMinimized Then
bRedrawFlag = True
End If
If frmChart.WindowState <> vbMinimized Then: frmChart.WindowState =
vbMaximized
gLastWindowState = frmChart.WindowState
' r = SystemParametersInfo(SPI_GETWORKAREA, 0&, rct, 0&)
'=========== CREATE STATUSBAR ===========
'Divide up screen width to use for panel spacing after converting to
pixels
iSBDivisions = (screen.width / screen.TwipsPerPixelX) / 100
'Size the StatusBar to fit the form
MoveWindow hWndStatus, 0, (ScaleHeight - SBHeight), _
ScaleWidth, SBHeight, 1
'This line is required for certain owner-draw
'panels to redraw correctly
InvalidateRect hWndStatus, ByVal 0&, 0
Const nParts As Long = 12
Dim wParts(0 To 11) As Long
'Set panel widths
wParts(0) = iSBDivisions * 20 'For the Data Directory
wParts(1) = iSBDivisions * 27 'Date
wParts(2) = iSBDivisions * 34 'Open
wParts(3) = iSBDivisions * 41 'High
wParts(4) = iSBDivisions * 48 'Low
wParts(5) = iSBDivisions * 55 'Close
wParts(6) = iSBDivisions * 60
wParts(7) = iSBDivisions * 67
wParts(8) = iSBDivisions * 73
wParts(9) = iSBDivisions * 83
wParts(10) = iSBDivisions * 94
wParts(11) = -1
'Tell the StatusBar how many panels we want
'and get it out of simple mode
'SendMessage hWndStatus, SB_SIMPLE, 0, ByVal 0&
SendMessage hWndStatus, SB_SETPARTS, nParts, wParts(0)
SendMessage hWndStatus, SB_SETTEXT, 11 + SBT_POPOUT, ByVal vbNullString
'blank
With pctChart
.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
DoEvents
pixWide = Me.ScaleX(.ScaleWidth, .ScaleMode, vbPixels)
pixHigh = Me.ScaleY(.ScaleHeight, .ScaleMode, vbPixels)
End With
End Sub
========================================
It all works just fine, until you MINIMIZE the application. When you restore
it (MAXIMIZE), the status bar is missing.
When I step through the program from MAX to MIN to MAX again, I note that
the ScaleHeight and ScaleWidth are the same value as when it worked the
prior to the MIN. So I'm puzzled as to why my status bar does not show up
anymore.
This used to work fine. But with the new graphic changes for the FixCycle
tool Mike and I were working on, this new problem propped up.
Mike, if you are reading this, you may notice the With pctChart... code at
the end of the Form_Resize routine. This is part of the code we were working
on without the .Autoredraw = false. Turned out that when you go from MIN to
MAX and change charts, it would draw the new chart over the old chart. I
also had to add .Picture = nothing to my ChartLoad routine just for extra
precaution.
Any idea about the Status bar?
Thanks.
Rick
.
- Follow-Ups:
- Re: API Status Bar - Mike?
- From: Randy Birch
- Re: API Status Bar - Mike?
- From: Mike Williams
- Re: API Status Bar - Mike?
- Prev by Date: Profiler for vb6
- Next by Date: Re: Menus with icons?
- Previous by thread: Profiler for vb6
- Next by thread: Re: API Status Bar - Mike?
- Index(es):
Relevant Pages
|