예제 #1
0
 // Use this for initialization
 void Start()
 {
     iButtonID      = Random.Range(0, 5);
     createButtons  = GameObject.Find("Canvas").GetComponent <CreateButtons>();
     goDestroyLimit = GameObject.Find("goDestroyLimit");
     PlayerPrefs.SetInt("bInstructions", 1);
 }
예제 #2
0
        void Form1_Load(object sender, EventArgs e)
        {
            dataGridView1.Visible = false;

            /*
             * Configure/set properties to properly
             * place buttons into a container, in this case a Panel
             * along with setting the button size and vertical spacing
             */
            CreateButtons MakeButtons = new CreateButtons()
            {
                ParentControl  = panel2,
                Base           = 10,
                ButtonBaseName = "btn",
                BaseAddition   = 60,
                ButtonSize     = new Size(100, 50)
            };

            /*
             * Setup a delegate so that when a button is clicked we
             * can use the tag property which in this case has the primary key
             * back to the record for the current customer in the database table.
             */
            MakeButtons.ClickedHandler += button_Clicker;

            /*
             * Generate buttons, CustomerIdentifier will be assigned to the button tag property
             * while CompanyName field is assigned to the Text property of the button.
             */
            MakeButtons.CreateButtonsFromTable(dataOperations.PopulateInitial(), "CustomerIdentifier", "CompanyName");
        }