Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 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 WindowsFormsApplication1
  12. {
  13. public partial class Firstwindow : Form
  14. {
  15. private Button gomb1;
  16. private Button gomb2;
  17. private Label szoveg;
  18. private TextBox szovegdoboz;
  19. public Form1()
  20. {
  21. InitializeComponent();
  22. this.Text = "SecondWindow";
  23. this.Size = new System.Drawing.Size (350,300);
  24. this.gomb1 = new Button();
  25. this.gomb1.Name = "gOMB 1et";
  26. this.gomb1.Text = "gobm1";
  27. this.gomb1.Size = new System.Drawing.Size(100,30);
  28. this.gomb1.Location = new System.Drawing.Point(50,100);
  29. this.gomb1.Click += new EventHandler (Button_Click);
  30. this.Controls.Add(gomb1);
  31.  
  32. this.gomb2 = new Button();
  33. this.gomb2.Name = "gOMB 2et";
  34. this.gomb2.Text = "gobm2";
  35. this.gomb2.Size = new System.Drawing.Size(100,30);
  36. this.gomb2.Location = new System.Drawing.Point(200,100);
  37. this.gomb2.Click += new EventHandler (gomb2_Click);
  38. this.Controls.Add(gomb2);
  39.  
  40. this.szoveg = new Label();
  41. this.szoveg.Text = "3ITM";
  42. this.szoveg.AutoSize = true;
  43. this.szoveg.Font = new System.Drawing.Font ("Arial", 12.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  44.  
  45. //this.szoveg.BackColor = System.Drawing.Color.Yellow;
  46. this.szoveg.Location = new System.Drawing.Point(130,50);
  47. this.Controls.Add(szoveg);
  48.  
  49. this.szovegdoboz = new TextBox();
  50. this.szovegdoboz.Location = new System.Drawing.Point(120,180);
  51. this.szovegdoboz.Size = new System.Drawing.Size(100,80);
  52. this.Controls.Add(szovegdoboz);
  53. }
  54.  
  55. protected void Button_Click(object sender, EventArgs e)
  56. {
  57. Button mp=(Button)sender;
  58. MessageBox.Show ("Hello nyomtad a:" + mp.Name);
  59. }
  60. protected void gomb2_Click(object sender, EventArgs e)
  61. {
  62. Button mp=(Button)sender;
  63. MessageBox.Show ("Hello nyomtad a:" + mp.Name);
  64. }
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement