+    wxCheckBoxState state = Get3StateValue();
+
+    if (state == wxCHK_UNCHECKED)
+    {
+        state = wxCHK_CHECKED;
+    }
+    else if (state == wxCHK_CHECKED)
+    {
+        // If the style flag to allow the user setting the undetermined state
+        // is set, then set the state to undetermined. Otherwise set state to
+        // unchecked.
+        if ( Is3rdStateAllowedForUser() )
+        {
+            state = wxCHK_UNDETERMINED;
+        }
+        else
+        {
+            state = wxCHK_UNCHECKED;
+        }
+    }
+    else if (state == wxCHK_UNDETERMINED)
+    {
+        state = wxCHK_UNCHECKED;
+    }
+    Set3StateValue(state);
+
+    event.SetInt(state);