Advertisement
Aaaaa988

Untitled

Apr 15th, 2021
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 21.52 KB | None | 0 0
  1. TType.cs
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Сalculator_RGZ
  9. {
  10.     //интерфейс, определяющий свойства кастомных типов данных
  11.     public interface TType<T>
  12.     {
  13.         T Sqr();
  14.         T Rev();
  15.         T Add(T b);
  16.         T Dvd(T b);
  17.         T Mul(T b);
  18.         T Sub(T b);
  19.     }
  20. }
  21.  
  22. TFrac.cs
  23. using System;
  24. using System.Collections.Generic;
  25. using System.Linq;
  26. using System.Text;
  27. using System.Threading.Tasks;
  28.  
  29. namespace Сalculator_RGZ
  30. {
  31.     public class TFrac: TType<TFrac>
  32.     {
  33.         public TFrac()
  34.         {
  35.             Num = 0;
  36.             Den = 1;
  37.         }
  38.         public int Num { get; private set; }
  39.         public int Den { get; private set; }
  40.  
  41.         public TFrac(int Numerator, int Deninator)
  42.         {
  43.             if (Deninator == 0)
  44.             {
  45.                 throw new ArgumentException("Deninator cannot be zero.", nameof(Deninator));
  46.             }
  47.             Num = Numerator;
  48.             Den = Deninator;
  49.             reduceTFrac();
  50.         }
  51.         public TFrac(string value)
  52.         {
  53.             string temp = value;
  54.             int _Num = Int32.Parse(temp.Split('/')[0]);
  55.             int _Den = Int32.Parse(temp.Split('/')[1]);
  56.             if (_Den == 0)
  57.             {
  58.                 throw new ArgumentException("Deninator cannot be zero.", nameof(_Den));
  59.             }
  60.             Num = _Num;
  61.             Den = _Den;
  62.             reduceTFrac();
  63.         }
  64.         //общий делитель для чеслителя и знаменателя
  65.         private int commonDiv()
  66.         {
  67.             if (Math.Abs(Num) == Math.Abs(Den))
  68.             {
  69.                 if (Num != 0 && Math.Abs(Den) != 1)
  70.                 {
  71.                     return Math.Abs(Num);
  72.                 }
  73.                 else
  74.                 {
  75.                     return 0;
  76.                 }
  77.  
  78.             }
  79.  
  80.             int n = Math.Abs(Num) > Math.Abs(Den) ? Math.Abs(Num) : Math.Abs(Den);
  81.             while (n > 1)
  82.             {
  83.                 if (Math.Abs(Num) % n == 0 && Math.Abs(Den) % n == 0)
  84.                 {
  85.                     return n;
  86.                 }
  87.                 n--;
  88.             }
  89.             return 0;
  90.         }
  91.         //операция сокращения дроби
  92.         private void reduceTFrac()
  93.         {
  94.             int cD = commonDiv();
  95.             cD *= Den < 0 ? -1 : 1;
  96.             while (cD != 0)
  97.             {
  98.                 Num /= cD;
  99.                 Den /= cD;
  100.                 cD = commonDiv();
  101.             }
  102.         }
  103.  
  104.         public TFrac Sqr()
  105.         {
  106.             return new TFrac(Num * Num, Den * Den);
  107.         }
  108.  
  109.         public TFrac Rev()
  110.         {
  111.             if (Num == 0)
  112.                 throw new Exception("Num cannot be zero in Rev.");
  113.             return new TFrac(Den, Num);
  114.         }
  115.  
  116.         public TFrac Negative(TFrac a) => new TFrac(-a.Num, a.Den);
  117.  
  118.         public TFrac Add(TFrac b)
  119.         {
  120.             TFrac res = new TFrac(this.Num * b.Den + b.Num * this.Den, this.Den * b.Den);
  121.             res.reduceTFrac();
  122.             return res;
  123.         }
  124.  
  125.         public TFrac Sub(TFrac b)
  126.             => this.Add(this.Negative(b));
  127.  
  128.         public TFrac Mul(TFrac b)
  129.         {
  130.             TFrac res = new TFrac(this.Num * b.Num, this.Den * b.Den);
  131.             res.reduceTFrac();
  132.             return res;
  133.         }
  134.  
  135.         public TFrac Dvd(TFrac b)
  136.         {
  137.             if (b.Num == 0)
  138.             {
  139.                 throw new DivideByZeroException();
  140.             }
  141.             TFrac res = new TFrac(this.Num * b.Den, this.Den * b.Num); ;
  142.             res.reduceTFrac();
  143.             return res;
  144.         }
  145.  
  146.         public TFrac Copy()
  147.         {
  148.             TFrac temp = new TFrac(Num, Den);
  149.             return temp;
  150.         }
  151.  
  152.         public override string ToString() => $"{Num}/{Den}";
  153.  
  154.         public static bool operator ==(TFrac arg1, TFrac arg2)
  155.         {
  156.             if (arg1.Num == 0 && arg2.Num == 0)
  157.             {
  158.                 return true;
  159.             }
  160.             else if (arg1.Den == arg2.Den && arg1.Num == arg2.Num)
  161.             {
  162.                 return true;
  163.             }
  164.             else
  165.             {
  166.                 return false;
  167.             }
  168.         }
  169.         public static bool operator !=(TFrac arg1, TFrac arg2)
  170.         {
  171.             if (arg1.Num == 0 && arg2.Num == 0)
  172.             {
  173.                 return false;
  174.             }
  175.             else if (arg1.Den == arg2.Den && arg1.Num == arg2.Num)
  176.             {
  177.                 return false;
  178.             }
  179.             else
  180.             {
  181.                 return true;
  182.             }
  183.         }
  184.  
  185.         public static bool operator >(TFrac arg1, TFrac arg2)
  186.         {
  187.             int Num1 = arg1.Num * arg2.Den;
  188.             int Num2 = arg2.Num * arg1.Den;
  189.             if (Num1 > Num2)
  190.             {
  191.                 return true;
  192.             }
  193.             return false;
  194.         }
  195.  
  196.         public static bool operator <(TFrac arg1, TFrac arg2)
  197.         {
  198.             int Num1 = arg1.Num * arg2.Den;
  199.             int Num2 = arg2.Num * arg1.Den;
  200.             if (Num1 < Num2)
  201.             {
  202.                 return true;
  203.             }
  204.             return false;
  205.         }
  206.     }
  207. }
  208.  
  209. Proc.cs
  210. using System;
  211. using System.Collections.Generic;
  212. using System.Linq;
  213. using System.Text;
  214. using System.Threading.Tasks;
  215.  
  216. namespace Сalculator_RGZ
  217. {
  218.     public enum TOprtn { None, Add, Sub, Mul, Dvd };
  219.     public enum TFunc { Rev, Sqr };
  220.     public class Proc<T> where T:TType<T>, new()
  221.     {
  222.         public T Lop_Res { get; set; }
  223.         public T Rop { get; set; }
  224.         public TOprtn Operation { get; set; }
  225.         public Proc(T Lop_Res,T Rop)
  226.         {
  227.             this.Lop_Res = Lop_Res;
  228.             this.Rop = Rop;
  229.             Operation = TOprtn.None;
  230.         }
  231.  
  232.         public Proc()
  233.         {
  234.             ProcClear();
  235.         }
  236.         public void ProcClear()
  237.         {
  238.             Lop_Res = default(T);
  239.             Rop = default(T);
  240.             Operation = TOprtn.None;
  241.         }
  242.         public void OprtnClear()
  243.         {
  244.             Operation = TOprtn.None;
  245.         }
  246.         //запуск операций
  247.         public void OprtnRun()
  248.         {
  249.             switch (Operation)
  250.             {
  251.                 case TOprtn.None:
  252.                     break;
  253.                 case TOprtn.Add:
  254.                     Lop_Res = Lop_Res.Add(Rop);
  255.                     break;
  256.                 case TOprtn.Sub:
  257.                     Lop_Res = Lop_Res.Sub(Rop);
  258.                     break;
  259.                 case TOprtn.Mul:
  260.                     Lop_Res = Lop_Res.Mul(Rop);
  261.                     break;
  262.                 case TOprtn.Dvd:
  263.                     Lop_Res = Lop_Res.Dvd(Rop);
  264.                     break;
  265.                 default:
  266.                     break;
  267.             }
  268.         }
  269.         //запуск функция
  270.         public void funcRun(TFunc Func)
  271.         {
  272.             switch (Func)
  273.             {
  274.                 case TFunc.Rev:
  275.                     Rop = Rop.Rev();
  276.                     break;
  277.                 case TFunc.Sqr:
  278.                     Rop = Rop.Sqr();
  279.                     break;
  280.                 default:
  281.                     break;
  282.             }
  283.         }
  284.  
  285.     }
  286. }
  287.  
  288. Memory.cs
  289. using System;
  290. using System.Collections.Generic;
  291. using System.Linq;
  292. using System.Text;
  293. using System.Threading.Tasks;
  294.  
  295. namespace Сalculator_RGZ
  296. {
  297.     public class Memory<T> where T : TType<T>, new()
  298.     {
  299.         private const int _OffT = 0;
  300.         private const int _OnT = 1;
  301.         private T ValueT;
  302.         private int StateT;
  303.         public Memory(T E)
  304.         {
  305.             ValueT = E;
  306.             StateT = _OffT;
  307.         }
  308.  
  309.         public Memory()
  310.         {
  311.             ValueT = new T();
  312.             StateT = _OffT;
  313.         }
  314.         //установить значение
  315.         public void Write(T E)
  316.         {
  317.             ValueT = E;
  318.             StateT = _OnT;
  319.         }
  320.         //получить значение
  321.         public T Get()
  322.         {
  323.             StateT = _OnT;
  324.             return ValueT;
  325.         }
  326.         //добавить значение к памяти
  327.         public void Add(T E)
  328.         {
  329.             ValueT = ValueT.Add(E);
  330.             StateT = _OnT;
  331.         }
  332.         //очистить память
  333.         public void Clear()
  334.         {
  335.             ValueT = new T();
  336.             StateT = _OffT;
  337.         }
  338.         public string ReadStateMemory()
  339.         {
  340.             return StateT.ToString();
  341.         }
  342.         public T ReadNumber()
  343.         {
  344.             return ValueT;
  345.         }
  346.     }
  347. }
  348.  
  349. FracControl.cs
  350. using System;
  351. using System.Collections.Generic;
  352. using System.Linq;
  353. using System.Text;
  354. using System.Threading.Tasks;
  355.  
  356. namespace Сalculator_RGZ
  357. {
  358.     public enum State { Rewrite, Result, Work };
  359.     public class FracControl
  360.     {
  361.         FracEditor fracEditor = new FracEditor();
  362.         Proc<TFrac> proc = new Proc<TFrac>();
  363.         Memory<TFrac> memory = new Memory<TFrac>();
  364.         public string insertVal(string val)
  365.         {
  366.             fracEditor.WriteString(val);
  367.             return fracEditor.ToString();
  368.         }
  369.         //вспомогательная функция
  370.         private string getOper(int i)
  371.         {
  372.             switch (i)
  373.             {
  374.                 case 1: return "+";
  375.                 case 2: return "-";
  376.                 case 3: return "*";
  377.                 case 4: return "/";
  378.             }
  379.             return "non";
  380.         }
  381.         public override string ToString()
  382.         {
  383.             return fracEditor.ToString();
  384.         }
  385.         public State St { get; set; }
  386.  
  387.         //предает управление редактору/процессору/памяти
  388.         public string DoCmnd(int j)
  389.         {
  390.             if (j >= 0 && j <= 20)
  391.             {
  392.                 if(St == State.Work)
  393.                 {
  394.                     St = State.Rewrite;
  395.                     fracEditor.Clear();
  396.                 }
  397.                 if (St == State.Result)
  398.                 {
  399.                     St = State.Rewrite;
  400.                     fracEditor.Clear();
  401.                     proc.ProcClear();
  402.                 }
  403.                 return fracEditor.Edit(j);
  404.             }
  405.             if (j >= 22 && j <= 25)
  406.             {
  407.                 if (St == State.Work)
  408.                 {
  409.                     return fracEditor.ToString();
  410.                 }
  411.                 if(St == State.Rewrite)
  412.                 {
  413.                     if(proc.Operation == TOprtn.None)
  414.                     {
  415.                         proc.Lop_Res = new TFrac(fracEditor.ToString());
  416.                     }
  417.                     else
  418.                     {
  419.                         proc.Rop = new TFrac(fracEditor.ToString());
  420.                         string his = proc.Lop_Res.ToString() + getOper((int)proc.Operation) + proc.Rop.ToString() + "=";
  421.                         proc.OprtnRun();
  422.                         his += proc.Lop_Res.ToString();
  423.                         History.L.Add(his);
  424.                         fracEditor.WriteString(proc.Lop_Res.ToString());
  425.                     }
  426.                 }
  427.                 switch (j)
  428.                 {
  429.                     case 22: proc.Operation = TOprtn.Add; break;
  430.                     case 23: proc.Operation = TOprtn.Sub; break;
  431.                     case 24: proc.Operation = TOprtn.Mul; break;
  432.                     case 25: proc.Operation = TOprtn.Dvd; break;
  433.                 }
  434.                 St = State.Work;
  435.                 return fracEditor.ToString();
  436.             }
  437.             if(j == 26 || j == 27)
  438.             {
  439.                 string his = fracEditor.ToString();
  440.                
  441.                 proc.Rop = new TFrac(fracEditor.ToString());
  442.                 if(j == 27)
  443.                 {
  444.                     proc.funcRun(TFunc.Rev);
  445.                     his += " Rev = " + proc.Rop.ToString();
  446.                     History.L.Add(his);
  447.                 }
  448.                 else
  449.                 {
  450.                     proc.funcRun(TFunc.Sqr);
  451.                     his += " Sqr = " + proc.Rop.ToString();
  452.                     History.L.Add(his);
  453.                 }
  454.                 if (EqualityComparer<TFrac>.Default.Equals(proc.Lop_Res, default(TFrac)))
  455.                 {
  456.                     proc.Lop_Res = proc.Rop;
  457.                 }
  458.                 fracEditor.WriteString(proc.Rop.ToString());
  459.                 return fracEditor.ToString();
  460.             }
  461.             if (j == 28)
  462.             {
  463.                
  464.                 if(proc.Operation == TOprtn.None)
  465.                 {
  466.                     St = State.Result;
  467.                     return fracEditor.ToString();
  468.                 }
  469.                 if(St != State.Result)
  470.                 {
  471.                     proc.Rop = new TFrac(fracEditor.ToString());
  472.                 }
  473.                 St = State.Result;
  474.                 string his = proc.Lop_Res.ToString() + getOper((int)proc.Operation) + proc.Rop.ToString() + "=";
  475.                 proc.OprtnRun();
  476.                 his += proc.Lop_Res.ToString();
  477.                 History.L.Add(his);
  478.                 fracEditor.WriteString(proc.Lop_Res.ToString());
  479.                 return fracEditor.ToString();
  480.             }
  481.             if (j == 29)
  482.             {
  483.                 proc.ProcClear();
  484.                 return fracEditor.Edit(18);
  485.             }
  486.             if(j == 30)
  487.             {
  488.                 memory.Clear();
  489.                 return fracEditor.ToString();
  490.             }
  491.             if (j == 31)
  492.             {
  493.                 memory.Write(new TFrac(fracEditor.ToString()));
  494.                 return fracEditor.ToString();
  495.             }
  496.             if (j == 32)
  497.             {
  498.                 fracEditor.WriteString(memory.Get().ToString());
  499.                 return fracEditor.ToString();
  500.             }
  501.             if (j == 33)
  502.             {
  503.                 memory.Add(new TFrac(fracEditor.ToString()));
  504.                 return fracEditor.ToString();
  505.             }
  506.             return fracEditor.ToString();
  507.         }
  508.     }
  509. }
  510.  
  511. FracEditor.cs
  512. using System;
  513. using System.Collections.Generic;
  514. using System.Linq;
  515. using System.Text;
  516. using System.Threading.Tasks;
  517. using System.Text.RegularExpressions;
  518.  
  519. namespace Сalculator_RGZ
  520. {
  521.     public enum PartToEdit { TOP, BOTTOM };
  522.  
  523.     public class FracEditor
  524.     {
  525.         private const string strSeparator = "/";
  526.         private const string strZero = "0/1";
  527.         public PartToEdit Mode { private get; set; }
  528.         private string strFraction;
  529.  
  530.         public FracEditor() {
  531.             Mode = PartToEdit.TOP;
  532.             strFraction = strZero;
  533.         }
  534.  
  535.         public bool IsZero()
  536.         {
  537.             return strFraction == strZero || strFraction == ("-" + strZero);
  538.         }
  539.  
  540.         public string AddSign()
  541.         {
  542.             if (strFraction[0] == '-')
  543.                 strFraction = strFraction.Substring(1);
  544.             else strFraction = '-' + strFraction;
  545.             return strFraction;
  546.         }
  547.  
  548.         public string Clear()
  549.         {
  550.             Mode = PartToEdit.TOP;
  551.             strFraction = strZero;
  552.             return strFraction;
  553.         }
  554.  
  555.         public override string ToString()
  556.         {
  557.             return strFraction;
  558.         }
  559.         //определяет соответствие формата
  560.         public void WriteString(string a)
  561.         {
  562.             Regex rg = new Regex("-?([0-9]+)/[1-9][0-9]*");
  563.             if (rg.IsMatch(a))
  564.                 strFraction = a;
  565.             else
  566.                 throw new Exception("Wrong value");
  567.         }
  568.  
  569.         //добавляет числовой символ
  570.         public string AddNumber(int a)
  571.         {
  572.             if (a < 0 || a > 10)
  573.                 throw new Exception("Wrong value");
  574.  
  575.             int indexSep = strFraction.IndexOf(strSeparator);
  576.             if (Mode == PartToEdit.TOP)
  577.             {
  578.                 if (strFraction[0] == '0')
  579.                     strFraction = strFraction.Remove(0, 1).Insert(0, a.ToString());
  580.                 else if (strFraction[0] == '-' && strFraction[1] == '0')
  581.                     strFraction = strFraction.Remove(1, 1).Insert(1, a.ToString());
  582.                 else
  583.                 {
  584.                     if (indexSep > 0)
  585.                         strFraction = strFraction.Insert(indexSep,a.ToString());
  586.                     else strFraction += a.ToString();
  587.                 }
  588.             }
  589.             else
  590.             {
  591.                 if(strFraction.Length < indexSep + 1)
  592.                     if (strFraction[indexSep + 1] == '0')
  593.                         strFraction = strFraction.Remove(indexSep + 1, 1);
  594.                 strFraction += a.ToString();
  595.             }
  596.             return strFraction;
  597.         }
  598.  
  599.         public string AddZero()
  600.         {
  601.             return AddNumber(0);
  602.         }
  603.  
  604.         public string DeleteCharacter()
  605.         {
  606.             if (Mode == PartToEdit.TOP)
  607.             {
  608.                 if (strFraction[0] == '0' || (strFraction[0] == '-' && strFraction[1] == '0'))
  609.                     return strFraction;
  610.                 else strFraction =  strFraction.Remove(strFraction.IndexOf(strSeparator) - 1, 1);
  611.  
  612.                 if (strFraction[0] == '/' || (strFraction[0] == '-' && strFraction[1] == '/'))
  613.                     strFraction = strFraction.Insert(strFraction.IndexOf(strSeparator),"0");
  614.             }
  615.             else
  616.             {
  617.                 if (strFraction.IndexOf(strSeparator) + 1 != strFraction.Length)
  618.                     strFraction =  strFraction.Remove(strFraction.Length - 1);
  619.             }
  620.             return strFraction;
  621.         }
  622.         //основная функция, определяющая операцию изменения содержимым
  623.         public string Edit(int a, string f = "")
  624.         {
  625.             if (a >= 0 && a <= 10)
  626.             {
  627.                 return AddNumber(a);
  628.             }
  629.             if(a == 16)
  630.             {
  631.                 return AddSign();
  632.             }
  633.             if (a == 17)
  634.             {
  635.                 return DeleteCharacter();
  636.             }
  637.             if (a == 18)
  638.             {
  639.                 return Clear();
  640.             }
  641.             if(a == 19)
  642.             {
  643.                 Mode = Mode == PartToEdit.TOP ? PartToEdit.BOTTOM : PartToEdit.TOP;
  644.             }
  645.             if (a == 21)
  646.             {
  647.                 WriteString(f);
  648.             }
  649.             return ToString();
  650.         }
  651.  
  652.     }
  653. }
  654.  
  655. History.cs
  656. using System;
  657. using System.Collections.Generic;
  658. using System.Linq;
  659. using System.Text;
  660. using System.Threading.Tasks;
  661.  
  662. namespace Сalculator_RGZ
  663. {
  664.     public static class History
  665.     {
  666.         public static List<string> L;
  667.         static History()
  668.         {
  669.             L = new List<string>();
  670.         }
  671.     }
  672. }
  673.  
  674. Form1.cs
  675. using System;
  676. using System.Collections.Generic;
  677. using System.ComponentModel;
  678. using System.Data;
  679. using System.Drawing;
  680. using System.Linq;
  681. using System.Text;
  682. using System.Threading.Tasks;
  683. using System.Windows.Forms;
  684. using System.Windows;
  685.  
  686. namespace Сalculator_RGZ
  687. {
  688.     public partial class Form1 : Form
  689.     {
  690.         public Form1()
  691.         {
  692.             InitializeComponent();
  693.             myControl = new FracControl();
  694.             textBox1.Text = myControl.ToString();
  695.             button24.Text = "/";
  696.             button24.Show();
  697.         }
  698.  
  699.         FracControl myControl;
  700.         //обраотчик нажатия кнопок
  701.         private void button1_Click(object sender, EventArgs e)
  702.         {
  703.             Button but = (Button)sender;
  704.             int j = Convert.ToInt16(but.Tag.ToString());
  705.             DoCmnd(j);
  706.         }
  707.         //Выполнить команду.
  708.         private void DoCmnd(int j)
  709.         {
  710.             if(j < 35)
  711.                 textBox1.Text = myControl.DoCmnd(j);
  712.         }
  713.         private void fullToolStripMenuItem_Click(object sender, EventArgs e)
  714.         {
  715.             button24.Show();
  716.         }
  717.         private void restrictionToolStripMenuItem_Click(object sender, EventArgs e)
  718.         {
  719.             button24.Hide();
  720.         }
  721.         private void AboutToolStripMenuItem_Click(object sender, EventArgs e)
  722.         {
  723.             AboutBox1 a = new AboutBox1();
  724.             a.Show();
  725.         }
  726.         private void HistoryToolStripMenuItem1_Click(object sender, EventArgs e)
  727.         {
  728.             Form2 history = new Form2();
  729.             history.Show();
  730.             if (History.L.Count() == 0)
  731.             {
  732.                 history.textBox1.AppendText("История пуста");
  733.                 return;
  734.             }
  735.             //Ообразить историю.
  736.             for (int i = 0; i < History.L.Count(); i++)
  737.             {
  738.                 history.textBox1.AppendText(History.L[i] + Environment.NewLine);
  739.             }
  740.         }
  741.         //обработчик нажатия клавиш
  742.         private void Form1_KeyPress(object sender, KeyPressEventArgs e)
  743.         {
  744.             int i = -1;
  745.             if (e.KeyChar >= 'A' && e.KeyChar <= 'F')
  746.                 i = (int)e.KeyChar - 'A' + 10;
  747.             if (e.KeyChar >= 'a' && e.KeyChar <= 'f')
  748.                 i = (int)e.KeyChar - 'a' + 10;
  749.             if (e.KeyChar >= '0' && e.KeyChar <= '9')
  750.                 i = (int)e.KeyChar - '0';
  751.             if (e.KeyChar == '-')
  752.                 i = 23;
  753.             if (e.KeyChar == '+')
  754.                 i = 22;
  755.             if (e.KeyChar == '*')
  756.                 i = 24;
  757.             if (e.KeyChar == '/')
  758.                 i = 25;
  759.             if (e.KeyChar == '=')
  760.                 i = 28;
  761.             if ((i < 10) || (i >= 16))
  762.                 DoCmnd(i);
  763.         }
  764.         //Обработка клавиш управления.
  765.         private void Form1_KeyDown(object sender, KeyEventArgs e)
  766.         {
  767.             if (e.KeyCode == Keys.Delete)
  768.                 //Клавиша Delete.
  769.                 DoCmnd(17);
  770.         }
  771.         //работа с буфером обмена
  772.         private void copyToolStripMenuItem_Click(object sender, EventArgs e)
  773.         {
  774.             Clipboard.SetText(myControl.ToString());
  775.         }
  776.         //работа с буфером обмена
  777.         private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
  778.         {
  779.             textBox1.Text = myControl.insertVal(Clipboard.GetText());
  780.         }
  781.     }
  782. }
  783.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement