Click Event not working

sterlingy

Active Member
Licensed User
Longtime User
A menuItem make a container Panel visible. In the container is another panel that when clicked, should make the container not visible, but the opCloseCtrl_Click is never executed.

Can anyone see what the problem might be?

Code: Copy
.
.
.
.
        opCloseCtrl.SetBackgroundImage(opCloseUpBMP)
   opContainer.AddView(opCloseCtrl, 45%x, 22%y, 10%x, 45%y)
   opCloseCtrl.Visible = True
   
   opContainer.Visible = False
   

   
   game.Initialize(gv, pad, lblFPS, lblAngle, lblScore, lblDogsRemain, lblPoopRemain, lblCurrLvl, lblShovelsLeft)
   
   Activity.AddMenuItem("Options", "mnuOptions")
End Sub

Sub mnuOptions_Click
   opContainer.Visible = True
End Sub

Sub opCloseCtrl_Click
   opCloseCtrl.SetBackgroundImage(opCloseDownBMP)
   opContainer.Visible = False
End Sub

-Sterling
 
You could have the wrong name in the close panel eventname. In the designer, or initialization code whichever you have used.

It's not possible to give a definite answer with so little code to go on.

-------------------
Sent via Tapatalk
 
Last edited:
Upvote 0
Steve,

You nailed it!

I forgot to add the name in the initialization.

Cheers,

Sterling
 
Upvote 0
Back
Top