Boolean and check box

2 posts / 0 new
Last post
Robert van den ...
Offline
Joined: 08/08/2018 - 07:37
Boolean and check box

I want to use a check box so that the user can decide of select a option or not. Now when the user starts the second part of the script the result of the menu is send back to the boolean (BenfordsA = MainMenu.BenfordsA). The problem is have is that i want to set the default value of the check box on (true). When i set  MainMenu.BenfordsA=True before the select case it wont be changed when the user starts the second part of the script with this code BenfordsA = MainMenu.BenfordsA. I think i place it in the wrong part of the script but the higher i place it the more static the value seems to be. It there a solution for this problem?

Brian Element's picture
Brian Element
Online
Joined: 07/11/2012 - 19:57

Hi Robert, 

Make the following adjustment to your code to set the checkbox as selected by default:

Function DisplayIt(ControlID$, Action%, SuppValue%)

Dim button As Integer
Dim dlg As MainMenu

'MainMenu.BenfordsA=True

Select Case Action%

Case 1
DlgValue "BenfordsA", 1
Case 2

The Case 1 indicate that the dialog is first opened and the DlgValue allows you to change a checkbox, 1 is selected, 0 is deselected and -1 is greyed out.

Brian