Advertisement
AalborgHTX

Multiforme

Apr 22nd, 2020
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApp37
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void btnKnap_Click(object sender, EventArgs e)
  21.         {
  22.             Form2 refTilAndetVindue = new Form2();
  23.             DialogResult svar = refTilAndetVindue.ShowDialog();
  24.             lblLabel.Text = svar.ToString();
  25.         }
  26.     }
  27. }
  28.  
  29.  
  30.  
  31. using System;
  32. using System.Collections.Generic;
  33. using System.ComponentModel;
  34. using System.Data;
  35. using System.Drawing;
  36. using System.Linq;
  37. using System.Text;
  38. using System.Threading.Tasks;
  39. using System.Windows.Forms;
  40.  
  41. namespace WindowsFormsApp37
  42. {
  43.     public partial class Form2 : Form
  44.     {
  45.         public Form2()
  46.         {
  47.             InitializeComponent();
  48.         }
  49.  
  50.         private void btnOk_Click(object sender, EventArgs e)
  51.         {
  52.             this.DialogResult = DialogResult.OK;
  53.         }
  54.  
  55.         private void btnCancel_Click(object sender, EventArgs e)
  56.         {
  57.             this.DialogResult = DialogResult.Cancel;
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement