[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

VB6 MsFlexGrid vertical scrollbar disappears!

(Mike Mitchell)

6/11/2011 4:13:00 PM

This has been irritating me for several weeks, but it's time I got to
the bottom of it. (I've already looked for similar problems in
groups.google.com, and while the problem is mentioned, no fix is
apparent.)

What happens is, I have a form (not my main form) with an MsFlexGrid
on it, maybe only with 1500 rows. Then the next time I look, the
vertical scrollbar has disappeared. Even if I close, then re-open the
form and reload the data the scrollbar does not reappear. I have to
shut down the app, then start it again, whereupon, on the form in
question, the scrollbar is back. For a while!

Has anyone else experienced this and knows what the cause/fix is?

The problem has been seen on XP and W2K.

Thanks.

MM
7 Answers

ralph

6/11/2011 5:11:00 PM

0

On Sat, 11 Jun 2011 17:12:51 +0100, MM <kylix_is@yahoo.co.uk> wrote:

>This has been irritating me for several weeks, but it's time I got to
>the bottom of it. (I've already looked for similar problems in
>groups.google.com, and while the problem is mentioned, no fix is
>apparent.)
>
>What happens is, I have a form (not my main form) with an MsFlexGrid
>on it, maybe only with 1500 rows. Then the next time I look, the
>vertical scrollbar has disappeared. Even if I close, then re-open the
>form and reload the data the scrollbar does not reappear. I have to
>shut down the app, then start it again, whereupon, on the form in
>question, the scrollbar is back. For a while!
>
>Has anyone else experienced this and knows what the cause/fix is?
>

It appears the intial state of the control is ok, but its internal
settings become corrupted during use. (I know - Duh! lol)

So look for something that is touching the control's properties. Most
likely something that appears benign and in a section of code that
"You absolutely KNOW is just fine!" <g>

Check all the default properties on Properties dialog. (They are
over-written by code... usually, but check anyway.

Instrument some mild 'stops' and 'redraws' at different points in the
code. Something like ...
Debug.Assert False
DoEvents

I vaguely remember that control getting "confused" if height or width
is changed dynamically, ie, if you mess with one, you have to mess
with the other. Might be superstition on my part.

sry that's all I got.
-ralph

ralph

6/11/2011 5:33:00 PM

0

On Sat, 11 Jun 2011 12:11:06 -0500, ralph <nt_consulting64@yahoo.net>
wrote:


>I vaguely remember that control getting "confused" if height or width
>is changed dynamically, ie, if you mess with one, you have to mess
>with the other. Might be superstition on my part.
>

"Partially visible" Rows is also a potential problem.

-ralph

(Mike Mitchell)

6/11/2011 6:01:00 PM

0

On Sat, 11 Jun 2011 12:33:27 -0500, ralph <nt_consulting64@yahoo.net>
wrote:

>On Sat, 11 Jun 2011 12:11:06 -0500, ralph <nt_consulting64@yahoo.net>
>wrote:
>
>
>>I vaguely remember that control getting "confused" if height or width
>>is changed dynamically, ie, if you mess with one, you have to mess
>>with the other. Might be superstition on my part.
>>
>
>"Partially visible" Rows is also a potential problem.
>
>-ralph

Since I reported the problem I've found another weird behaviour. The
scrollbar stays visible, but neither the cursor keys nor page up/down
work to move from row to row!

I've never see this problem or the problem of the scrollbar
disappearing in any other VB6 app I've written over, ooh, 15 years?

MM

ralph

6/11/2011 7:57:00 PM

0

On Sat, 11 Jun 2011 19:00:44 +0100, MM <kylix_is@yahoo.co.uk> wrote:

>On Sat, 11 Jun 2011 12:33:27 -0500, ralph <nt_consulting64@yahoo.net>
>wrote:
>
>>On Sat, 11 Jun 2011 12:11:06 -0500, ralph <nt_consulting64@yahoo.net>
>>wrote:
>>
>>
>>>I vaguely remember that control getting "confused" if height or width
>>>is changed dynamically, ie, if you mess with one, you have to mess
>>>with the other. Might be superstition on my part.
>>>
>>
>>"Partially visible" Rows is also a potential problem.
>>
>>-ralph
>
>Since I reported the problem I've found another weird behaviour. The
>scrollbar stays visible, but neither the cursor keys nor page up/down
>work to move from row to row!
>
>I've never see this problem or the problem of the scrollbar
>disappearing in any other VB6 app I've written over, ooh, 15 years?
>

I vaguely remember having trouble with the Horizontal bar. That time
it was because of a dynamic change in width. I think a colleague
fought a complete disappearing act once while redrawing. The rest is
just what I've picked up here from OPs.

I seldom use the MsHFlexGrid control so the odds for me are smaller.
<g>

I'm sure you have already done multiple online searches.

Something to try, which frankly borders on superstition, is to open
the Form in an editor and look for something "strange" in its
Properties.

Is the code relatively self-contained that you might reproduce it in a
single Form test project? (Sometimes easier to accomplish if you make
a copy of current project and start slashing and chopping.)

An alternative is to create a 'test' Form in your existing project
then 'copy' the control over.

Or you simply might re-build the project. While a big PITA often
"resolves" bizzare VB mysteries.

-ralph


(nobody)

6/12/2011 3:26:00 AM

0

MM wrote:
> Even if I close, then re-open the
> form and reload the data the scrollbar does not reappear. I have to
> shut down the app, then start it again, whereupon, on the form in
> question, the scrollbar is back. For a while!

Are you by any chance canceling the Unload, and hiding the form instead?


(nobody)

6/12/2011 5:58:00 AM

0

Nobody wrote:
> MM wrote:
>> Even if I close, then re-open the
>> form and reload the data the scrollbar does not reappear. I have to
>> shut down the app, then start it again, whereupon, on the form in
>> question, the scrollbar is back. For a while!
>
> Are you by any chance canceling the Unload, and hiding the form
> instead?

Also, try adding this magical line as the last line in Form_Unload of the
form that is holding the MsFlexGrid control:

Set frmMsFlexGrid = Nothing

You can't use "Me" above(it will generate a compile error). You have to use
the form name.



(Mike Mitchell)

6/12/2011 6:40:00 AM

0

On Sun, 12 Jun 2011 01:57:52 -0400, "Nobody" <nobody@nobody.com>
wrote:

>Nobody wrote:
>> MM wrote:
>>> Even if I close, then re-open the
>>> form and reload the data the scrollbar does not reappear. I have to
>>> shut down the app, then start it again, whereupon, on the form in
>>> question, the scrollbar is back. For a while!
>>
>> Are you by any chance canceling the Unload, and hiding the form
>> instead?
>
>Also, try adding this magical line as the last line in Form_Unload of the
>form that is holding the MsFlexGrid control:
>
>Set frmMsFlexGrid = Nothing
>
>You can't use "Me" above(it will generate a compile error). You have to use
>the form name.

Okay, I'll try it later, thanks.

MM