API Status Bar - Mike?



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



.



Relevant Pages

  • Re: API Status Bar - Mike?
    ... The API statusbar will not be recognized by VB, ... values you retrieve will include the area taken up by the status bar. ... : Dim bRedrawFlag As Boolean ... 'Divide up screen width to use for panel spacing after converting to ...
    (comp.lang.basic.visual.misc)
  • Re: Need Graphical Design Tips/Approach
    ... Here is another method that stores each vertical section of the panel ... Dim i As Long ... Private Sub AddBarGroup) ... For Each bar In Bars ...
    (microsoft.public.vb.general.discussion)
  • Re: electrical - tester says hot/neu or hot/grd reversed
    ... be a circuit or the whole panel. ... current path that will trip a circuit breaker. ... wired white to the neutral bar (where the other 110v white wires were ... Neutral-ground bond required (neutral ...
    (alt.home.repair)
  • Re: I want to change Search Engine
    ... the MSN search panel and no ption anywhere to change preferences. ... I seem to be missing this option of change preferences no matter what I do! ... > Entering keywords into the address bar will still trigger an MSN search. ... > entered in the address bar will now be sent to your preferred search engine. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: I want to change Search Engine
    ... This opens a side panel ... If your side panel has the animated search character, ... Entering keywords into the address bar will still trigger an MSN search. ... entered in the address bar will now be sent to your preferred search engine. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)