Solved

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

Posted on 2014-02-14
17
229 Views
Last Modified: 2014-02-23
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
Comment
Question by:isnoend2001
  • 9
  • 8
17 Comments
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
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
 
LVL 13

Accepted Solution

by:
Chris Raisin earned 500 total points
Comment Utility
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
 

Author Comment

by:isnoend2001
Comment Utility
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
 

Author Comment

by:isnoend2001
Comment Utility
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
 

Author Closing Comment

by:isnoend2001
Comment Utility
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
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
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
 

Author Comment

by:isnoend2001
Comment Utility
Thanks i will give it a go
0
 

Author Comment

by:isnoend2001
Comment Utility
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
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
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
Any further problems?
0
 

Author Comment

by:isnoend2001
Comment Utility
no
 thanks
0
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
I'm actually enquiring whether it all works now.  :-)
0
 

Author Comment

by:isnoend2001
Comment Utility
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
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
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
 

Author Comment

by:isnoend2001
Comment Utility
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
 
LVL 13

Expert Comment

by:Chris Raisin
Comment Utility
Oops! My apologies.

I missed that completely.

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

Cheers
Chris
0
 

Author Comment

by:isnoend2001
Comment Utility
Good, glad it's closed
No Problem
thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now