Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-02-14
17
Medium Priority
?
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
17 Comments
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 39861322
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 2000 total points
ID: 39861331
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
ID: 39861335
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:isnoend2001
ID: 39861364
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
ID: 39861411
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
ID: 39861446
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
ID: 39861455
Thanks i will give it a go
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 39862081
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
ID: 39880630
Any further problems?
0
 

Author Comment

by:isnoend2001
ID: 39880641
no
 thanks
0
 
LVL 13

Expert Comment

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

Author Comment

by:isnoend2001
ID: 39880667
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
ID: 39880691
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
ID: 39880704
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
ID: 39881204
Oops! My apologies.

I missed that completely.

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

Cheers
Chris
0
 

Author Comment

by:isnoend2001
ID: 39881224
Good, glad it's closed
No Problem
thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

618 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