/// <summary> /// Handles the Click event of the pbFb control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void pbFb_Click(object sender, EventArgs e) { // Initialize and open a modal form for the Facebook OAuth login FacebookLogin fbl = new FacebookLogin(); fbl.ShowDialog(this); // AccessToken will be empty "" if login fails or window was closed manually AccessToken = fbl.AccessToken; // Enable 'Download' button if login is successful, and display a message instead of the previous login image button if (AccessToken != "") { pbFb.Visible = false; lblL1.Visible = true; btnADown.Enabled = true; } }