isnoend2001
asked on
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
Cleopatra-Flicker.zip
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
Cleopatra-Flicker.zip
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
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.
ASKER
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
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
ASKER
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
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
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:
Are we any closer?
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
Are we any closer?
ASKER
Thanks i will give it a go
ASKER
Thanks
The LockWindowUpdate i got here
https://www.experts-exchange.com/questions/28324960/Problem-msflexgrid-flickering.html
The LockWindowUpdate i got here
https://www.experts-exchange.com/questions/28324960/Problem-msflexgrid-flickering.html
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!) :-)
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!) :-)
Any further problems?
ASKER
no
thanks
thanks
I'm actually enquiring whether it all works now. :-)
ASKER
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
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
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.
ASKER
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
Accepted Solution
by: craisinPosted on 2014-02-15 at 05:55:59ID: 39861331
Oops! My apologies.
I missed that completely.
Thanks very much, and good luck with your project. :-)
Cheers
Chris
I missed that completely.
Thanks very much, and good luck with your project. :-)
Cheers
Chris
ASKER
Good, glad it's closed
No Problem
thanks
No Problem
thanks
I think it has something to do with the width of flexStatus, which seems enormous.
Stand by
Christopher(craisin)