Help with a Menu-Script

I’ve got a Script that’s suppoused to pause a scene and activate a canvas (lika a menu), its not working, unity Console says : “Assets/PausenMenu/PauseMenuC.cs(16,33): error CS0200: Property or indexer `UnityEngine.GameObject.gameObject’ cannot be assigned to (it is read only)”
Here’s the Script!

using UnityEngine;
using System.Collections;

public class PauseMenuC : MonoBehaviour {

	public GameObject PauseUI;
	public bool paused = false;
	public CanvasGroup myCanvas;
	void Update () {

		if (Input.GetKeyDown("p") && paused == false)
			paused = true;
			Time.timeScale = 0;
			PauseUI.gameObject = true;
		else if (Input.GetKeyDown("p") && paused == true)
			paused = false;
			Time.timeScale = 1;
			PauseUI.gameObject = false;

Setting the gameObject property to true or false will not work, firstly because (as the error states) the property is read-only, and secondly because the type of gameObject is GameObject and not bool.

To enable or disable a gameObject, use the SetActive method like so: