• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

probably something easy, but i do not seem to find it

This is an 80 number keno game using the msflexgrid
I pulled this form from a larger project to try and control msflexgrid flickering
The wins is when most of the flickering starts and is based on the numbers in flexStatus.
But no matter what i try i cannot get flexStatus to show, so i get no wins
i have checked the following:
Visible
Zorder
height, width
top, left
The program is supposed to run 12 times, but for testing i cut the runs to 5
At the end of a run labels are rotated the amount of the win
Clicking anywhere causes the win to add up instantly if the user does not want to wait

guess i can only upload 1 file at a time will post again with the project attached
jpgCleopatra-Flicker.zip
0
isnoend2001
Asked:
isnoend2001
  • 9
  • 8
1 Solution
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Tricky...I am looking into it.

I think it has something to do with the width of flexStatus, which seems enormous.

Stand by

Christopher(craisin)
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Your flexStatus grid is INSIDE the picturebox "picLeftSideFlex" and so when that picture box paints it writes over your control.

Select the flexStatus object in your editor, Press "ctrl+X" (to cut the object), move the cursor to a free area on the side of your form and then perform a "Paste" via "Ctrl+P".

Then right click on the object flexStatius and make sure "Bring to front" is selected.

I notice the box then appears for some time but disappears again (probably in the positioning of the object via your code or some other processing).

This should put you on the right track.

When objects mysteriously disappear it is usually because they are contained in
picture boxes or other containers.

If you need some more help with this, only too glad to help.

Chris (craisin)
0
 
isnoend2001Author Commented:
thanks after more testing i have found that the flicker is so bad it is effecting the flexstatus.
i put a break on Sub Generate20Numbers and it shows. when i copied this form from the main app. the flicker was only affecting the 80 number grid not the images and flexStatus.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
isnoend2001Author Commented:
putting a sleep shows the flexstatus until the first run starts. then it disappears along with the image at the top
Public Sub StartBonus()
  Dim i As Integer
  For i = 1 To miMax_Runs '12 constant
   Sleep 2500
    Generate20Numbers 'run 12 times
    Next
    Unload Me
End Sub
0
 
isnoend2001Author Commented:
thanks
Pasted flexstatus outside the picturebox and removed this from
Sub Generate20Numbers
took out this out the sub 2 places
 Me.Refresh
and the flexstatus stays visible
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
There is no such call as "LockWindowUpdate False"
The correct way to call it is "LockWindowUpdate 0"  
("False" is a boolean an not a numeric and so it may be causing problem with that call.)

So in your procedure "CheckIfWin", you need to move the LockWindow procedure outside the loop (after all you do not want to lock it 20 times!), and then unlock it after the loop is finished.

So the code there should be:

      LockWindowUpdate flexStatus.hWnd
      For i = 1 To EndRow
          If miHits >= Val(flexStatus.TextMatrix(i, 0)) Then ' check first row first
             mcurWinCurrentRun = Val(flexStatus.TextMatrix(i, 1))
             mbWinningRun = True
             DoEvents
             ReSetForColorFlexStatus 'if more than 1 win reset prev color to blue
             flexStatus.Row = i
             flexStatus.Col = 0
             flexStatus.CellForeColor = vbRed
             DoEvents
             flexStatus.Row = i
             flexStatus.Col = 1
             flexStatus.CellForeColor = vbRed 'SET THE SECOND col to red
             CheckIfWin = True
             mcurWinCurrentRun = mWinAmout
             miCreditsWon = Val(flexStatus.TextMatrix(i, 1))
          End If
      Next
      LockWindowUpdate 0 'unlocks currently locked window since 
                                          'only one window can be locked at a time

Open in new window




Are we any closer?
0
 
isnoend2001Author Commented:
Thanks i will give it a go
0
 
isnoend2001Author Commented:
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
It depends on whether "False" evaluates as 0in your code. If it does, then it should be OK, but you definately should have the "Lock" functions outside the loop (for efficiency).

Perhaps also, placing multiple locks on a window MAY (I say MAY) mean multiple "Unlock" processes are needed (although the documentation for "LockWindowUpdate" states only one lock at a time can be placed on a window (making the multiple calls within a loo ineffective but still requiring processing time).

It all seems to work on my system (although the "beep" calls are driving me crazy!) :-)
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Any further problems?
0
 
isnoend2001Author Commented:
no
 thanks
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
I'm actually enquiring whether it all works now.  :-)
0
 
isnoend2001Author Commented:
Don't remember exactly, but i think
 I stopped working on it. Didn't have the problem when the form was part of the larger project. but i will keep an eye on it to see if it resurfaces
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Well this question needs some closure. If you find that the question you originally asked has been solved by my interaction and advice then you need to close it and award points, otherwise it could remain in "limbo" forever.
0
 
isnoend2001Author Commented:
As far as i can tell it has been closed an points awarded:

Accepted Solution

by: craisinPosted on 2014-02-15 at 05:55:59ID: 39861331
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Oops! My apologies.

I missed that completely.

Thanks very much, and good luck with your project.   :-)

Cheers
Chris
0
 
isnoend2001Author Commented:
Good, glad it's closed
No Problem
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 9
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now