Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Firstwindow : Form
- {
- private Button gomb1;
- private Button gomb2;
- private Label szoveg;
- private TextBox szovegdoboz;
- public Form1()
- {
- InitializeComponent();
- this.Text = "SecondWindow";
- this.Size = new System.Drawing.Size (350,300);
- this.gomb1 = new Button();
- this.gomb1.Name = "gOMB 1et";
- this.gomb1.Text = "gobm1";
- this.gomb1.Size = new System.Drawing.Size(100,30);
- this.gomb1.Location = new System.Drawing.Point(50,100);
- this.gomb1.Click += new EventHandler (Button_Click);
- this.Controls.Add(gomb1);
- this.gomb2 = new Button();
- this.gomb2.Name = "gOMB 2et";
- this.gomb2.Text = "gobm2";
- this.gomb2.Size = new System.Drawing.Size(100,30);
- this.gomb2.Location = new System.Drawing.Point(200,100);
- this.gomb2.Click += new EventHandler (gomb2_Click);
- this.Controls.Add(gomb2);
- this.szoveg = new Label();
- this.szoveg.Text = "3ITM";
- this.szoveg.AutoSize = true;
- this.szoveg.Font = new System.Drawing.Font ("Arial", 12.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- //this.szoveg.BackColor = System.Drawing.Color.Yellow;
- this.szoveg.Location = new System.Drawing.Point(130,50);
- this.Controls.Add(szoveg);
- this.szovegdoboz = new TextBox();
- this.szovegdoboz.Location = new System.Drawing.Point(120,180);
- this.szovegdoboz.Size = new System.Drawing.Size(100,80);
- this.Controls.Add(szovegdoboz);
- }
- protected void Button_Click(object sender, EventArgs e)
- {
- Button mp=(Button)sender;
- MessageBox.Show ("Hello nyomtad a:" + mp.Name);
- }
- protected void gomb2_Click(object sender, EventArgs e)
- {
- Button mp=(Button)sender;
- MessageBox.Show ("Hello nyomtad a:" + mp.Name);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement