PDA

View Full Version : Problem with checkbox's



ColinSW
05-25-2023, 04:41 AM
Changing and restoring the visbility setting of a checkbox disables its ability to be ticked until the slide show is stopped and restarted.
I've tried manipulating various settings such as locked at the same time but can't find anything that works.
Any advice on what might be going wrong?

John Wilson
05-25-2023, 06:24 AM
You might want to say what code you are using to hide / show the checkbox.

ColinSW
05-25-2023, 07:01 AM
You might want to say what code you are using to hide / show the checkbox.


Sub Lockclosed()
Dim i As Integer
Dim A As String
A = InputBox("Sorry, only teachers can use this")
If A = "magister" Then
Slide7.Shapes("CheckBox1").Visible = True
For i = 1 To 52
ActivePresentation.Slides(i).Shapes("Oval77").Visible = False
ActivePresentation.Slides(i).Shapes("Hint").Visible = False
ActivePresentation.SlideMaster.Shapes("Lockopen").Visible = True
ActivePresentation.SlideMaster.Shapes("Lockclosed").Visible = False
Next i
End If
End Sub

Sub Lockopen()
Dim i As Integer
Slide7.Shapes("CheckBox1").Visible = False
For i = 1 To 52
ActivePresentation.Slides(i).Shapes("Oval77").Visible = True
ActivePresentation.Slides(i).Shapes("Hint").Visible = True
ActivePresentation.SlideMaster.Shapes("Lockopen").Visible = False
ActivePresentation.SlideMaster.Shapes("Lockclosed").Visible = True
Next i
End Sub

ColinSW
05-25-2023, 07:08 AM
As the checkbox functionality is unaffected until I change its visibility setting I've tried hiding and displaying it using a shape above it. This failed because the checkbox always displays above the shape when in display mode, regardless of the z order set in edit mode.

John Wilson
05-25-2023, 07:45 AM
Does this format work


Slide7.Shapes("CheckBox1").OLEFormat.Object.Visible = True

ColinSW
05-25-2023, 07:59 AM
I've solved the problem - leaving the visbility of the checkbox alone but setting the z order to 0 in the code when I want it hidden.

ColinSW
05-25-2023, 08:02 AM
Sorry, I missed your response, but I've resolved the problem another way in the meantime. I set the z order to 0 in the code. The checkbox seems to ignore the z order setting of the edit view selection pane, but it works by setting it in the code. Thanks for your help.

John Wilson
05-25-2023, 08:12 AM
To the best of my knowledge z order cannot be set to 0. What code did you use?

chronjy
05-26-2023, 09:59 AM
it works


Set shp = sld.Shapes("CheckBox1")
shp.ZOrder msoBringForward
shp.ZOrder msoSendToBack

chronjy
05-26-2023, 10:02 AM
Set shp = sld.Shapes("CheckBox1")
shp.ZOrder msoBringForward
shp.ZOrder msoSendToBack

John Wilson
05-26-2023, 10:58 AM
That doesn't set it to 0 though but as long as it works for you.