MainForm.cs 473 B

123456789101112131415161718192021
  1. namespace PictureMover
  2. {
  3. public partial class MainForm : Form
  4. {
  5. private readonly CoverForm _form2;
  6. public MainForm()
  7. {
  8. InitializeComponent();
  9. _form2 = new CoverForm(this);
  10. }
  11. private void Form_Shown(object sender, EventArgs e)
  12. {
  13. _form2.Show(this);
  14. Enter += Form_Enter;
  15. }
  16. private void Form_Enter(object? sender, EventArgs e) => _form2.Focus();
  17. }
  18. }