j4ggi

app_2windows

Dec 11th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. namespace textbox
  4. {
  5.     public partial class wynik_wyjscie : Form
  6.     {
  7.         private TextBox pole;
  8.    
  9.         public void tekst(string txt)
  10.         {
  11.             pole = new TextBox();
  12.             pole.Parent = this;
  13.             pole.Dock = DockStyle.Fill;
  14.             pole.Text = txt;
  15.         }
  16.  
  17.         public wynik_wyjscie(string txt)        //to jest konstruktor więc nazwa musi być taka sama jak nazwa klasy i nic nie zwraca
  18.         {
  19.             this.Text="Wynik";
  20.             this.AutoSize = true;
  21.             tekst(txt);
  22.         }
  23.     }
  24.     class Program
  25.     {
  26.         public static void Main(string[] args)
  27.         {
  28.             Application.Run(new wynik_wyjscie("Jakiś niezbyt długi tekst"));
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment