当前位置: 首页>>代码示例>>C#>>正文


C# TextBox.AppendText方法代码示例

本文整理汇总了C#中System.Windows.Forms.TextBox.AppendText方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.AppendText方法的具体用法?C# TextBox.AppendText怎么用?C# TextBox.AppendText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TextBox的用法示例。


在下文中一共展示了TextBox.AppendText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FillMemo

 public static void FillMemo(TextBox lb, List<string> list)
 {
     lb.Clear();
     foreach(var s in list) {
         if (lb.Text.Length > 0)
         lb.AppendText(Environment.NewLine);
         lb.AppendText(s);
     }
 }
开发者ID:emm274,项目名称:fcObj,代码行数:9,代码来源:xedits.cs

示例2: PrintMatrix

 public void PrintMatrix(TextBox tb)
 {
     for (int i = 0; i < P; i++) {
         for (int j = 0; j < N; j++) {
             tb.AppendText(A[i,j] + " ");
         }
         tb.AppendText("\n");
     }
     for (int i = 0; i < P; i++) {
         tb.AppendText(B[i] + "\n");
     }
 }
开发者ID:alexflorea,项目名称:CN,代码行数:12,代码来源:Matrix.cs

示例3: printOutResult

 public void printOutResult(List<string> resultStrings, TextBox textbox)
 {
     textbox.Text = "";
     if (resultStrings.Count() == 0)
     {
         textbox.AppendText("No Result");
         return;
     }
     foreach (string resultString in resultStrings)
     {
         textbox.AppendText(resultString + Environment.NewLine);
     }
 }
开发者ID:tamhoang2806,项目名称:Thermometer,代码行数:13,代码来源:OutputHandler.cs

示例4: OnDataReceived

        private void OnDataReceived(object sender, EventArgs e)
        {
            Device d = (Device)sender;
            TextBox lm_value = new TextBox();
            lm_value.Text = "datarecieved";
            Device.DataEventArgs de = (Device.DataEventArgs)e;
            NeuroSky.ThinkGear.DataRow[] tempDataRowArray = de.DataRowArray;

            TGParser tgParser = new TGParser();
            tgParser.Read(de.DataRowArray);

            //bool hasBlink = false;
            //int blinkeye = 0;

            /* Loops through the newly parsed data of the connected headset*/
            // The comments below indicate and can be used to print out the different data outputs.

            //            for (int i = 0; i < tgParser.ParsedData.Length; i++)
            //            {
            //                if (radio_att.Checked == true & tgParser.ParsedData[i].ContainsKey("Attention")
            //                    )
            //                {
            //
            //                    updateAttentionMode(tgParser, i);
            //
            //                }
            //                else if (radio_me.Checked == true & tgParser.ParsedData[i].ContainsKey("Meditation")
            //                    )
            //                {
            //                    updateMediationMode(tgParser, i);
            //                }
            //
            //             }

            for (int i = 0; i < tgParser.ParsedData.Length; i++)
            {
                if (tgParser.ParsedData[i].ContainsKey("Attention"))
                {

                    lm_value.AppendText("Att Value:" + tgParser.ParsedData[i]["Attention"]);
                    Equals("Att Value:" + tgParser.ParsedData[i]["Attention"]);
                }
                if (tgParser.ParsedData[i].ContainsKey("Meditation"))
                {

                    lm_value.AppendText("Med Value:" + tgParser.ParsedData[i]["Meditation"]);
                    Equals("Med Value:" + tgParser.ParsedData[i]["Meditation"]);
                }
            }
        }
开发者ID:andrehendriks,项目名称:WindowsFormApplication1,代码行数:50,代码来源:Form2.cs

示例5: cyberplatProcessing

 /// <summary>
 /// Этот метод производит обработку данных ПС киберплат. На вход подается массив ссылок на киберплат Links. 
 /// Остальные три параметра - граф. эл-ты соответсвующего типа.
 /// </summary>
 /// <param name="Links">Массив ссылок на киберплат</param>
 /// <param name="dataBox">Поле, в которое выводится лог.</param>
 /// <param name="progress">Прогресбар 1</param>
 /// <param name="progress2">Прогресбар 2</param>
 /// <returns>Возвращает сумму за текущий час в строковом формате с запятой.</returns>
 public static string cyberplatProcessing(string[] Links, TextBox dataBox, ProgressBar progress, ProgressBar progress2)//обработка киберплата
 {
     double summa = 0;
     string tmpTime = "";
     string s1 = "";
     string s2 = "";
     string s3 = "";
     string s4 = "";
     for (int i = 0; i < 20; i++)
     {
         Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
         NumberStyles styles;
         styles = NumberStyles.AllowParentheses | NumberStyles.AllowTrailingSign | NumberStyles.Float | NumberStyles.AllowThousands;
         tmpTime = cybertime;
         if (tmpTime != "") { s3 = tmpTime.Remove(3, 2); }
         s1 = Downloader.Download(Links[i]);
         s2 = s1.Substring(s1.IndexOf("Всего") + 228, 100);               //поиск слова "Всего" в документе и сдвиг на 228 символов от него(несколько строк вниз) и выемка 50 символов
         Regex regex = new Regex("([0-9]+.+[0-9])");                       //регулярка для поиска числа в строке
         Match match = regex.Match(s2);
         if (match.Value != "")
         {
             summa = summa + Double.Parse(match.Value, styles);
             dataBox.AppendText(regions[i] + "\n");
             dataBox.AppendText(match.Value + "\n");// вывод в textBox2
             dataBox.AppendText((s1.Substring(s1.IndexOf("Данные отчета актуальны"), 49)).Replace("<b>&nbsp;", " ") + "\n");
             dataBox.AppendText("\n");
             cybertime = ((s1.Substring(s1.IndexOf("Данные отчета актуальны")+44, 5)));
             if (cybertime != "") { s4 = cybertime.Remove(3, 2); }
             if (i >0 & s3 != s4)
             {
                 progress.Value = 0;
                 progress2.Value = 0;
                 return cyberplatProcessing(Links,  dataBox,  progress,  progress2);
             }
         }
         else
         {
             summa = summa + 0;
             dataBox.AppendText(regions[i] + "\n");
             dataBox.AppendText("0.00" + "\n");
             dataBox.AppendText("Отчёт ещё не сформирован" + "\n");
             dataBox.AppendText("\n");
         }
         progress.PerformStep();
         progress2.PerformStep();
     }
     dataBox.AppendText("Данные сняты");
     string result = (summa.ToString()).Replace(".", ",");//замена точки на запятую(для удобства)
     return result;
 }
开发者ID:DenisMikheev,项目名称:AutoSverKa-v2.x.x.x,代码行数:59,代码来源:DataProcessing.cs

示例6: PrintRadacini

 public void PrintRadacini(TextBox tb)
 {
     tb.Clear();
     for (int i = 0; i < radacini.Count; i++) {
         tb.AppendText(radacini[i] + "\n");
     }
 }
开发者ID:alexflorea,项目名称:CN,代码行数:7,代码来源:Function.cs

示例7: StartAnomalyDetection

 public static void StartAnomalyDetection(TextBox warningTextBox)
 {     
     if (DoneSettingNormalUsage)
     {
         if (CPUMonitor.CPUCounter > NormalCPU)
         {
             if (warningTextBox.Text.Length == 0)
             {
                 warningTextBox.Invoke(new Action(() =>
                 {
                     warningTextBox.Text = "CPU Usage: " + CPUMonitor.CPUCounter.ToString("F2") + "%";
                     CPUMonitor.CPUWarnings = warningTextBox.Text;
                 }));
             }
             else
             {
                 warningTextBox.Invoke(new Action(() =>
                 {
                 warningTextBox.AppendText("\r\nCPU Usage: " + CPUMonitor.CPUCounter.ToString("F2") + "%");
                     CPUMonitor.CPUWarnings = warningTextBox.Text;
                 }));
             }
         }
     }
 }
开发者ID:MikeHardman,项目名称:acIDS,代码行数:25,代码来源:CPUAnomalies.cs

示例8: part3

        //part3 поиск по маске рлецб  p2[3] + p2[2] + * + p2[7] + p2[1]
        public string part3(string str3,string strch,TextBox txtbox)
        {
            //должна вернуть слово(список слов)
            System.IO.StringReader file = new System.IO.StringReader(Properties.Resources.Dictionary);
            string line="";
            string tmp3="";
            string res = str3+"(";
            int ctr = 0;

            string toTxt3 = strch + " - ";
            while ((line = file.ReadLine()) != null)
            {
                tmp3 = line.Trim();
                if(tmp3.Length == 5)
                {
                    if (tmp3[0] == str3[3] && tmp3[1] == str3[2] && tmp3[3] == str3[7] && tmp3[4] == str3[1])
                    {
                        res = res + tmp3 + ", ";
                        toTxt3 = toTxt3 + part4(tmp3);//+
                        ctr++;
                    }
                }
            }

            if (toTxt3 != strch + " - ")
            {
                txtbox.AppendText(toTxt3 + "\r\n");
            }

            if (ctr == 0) { res = ""; }
            else {
                res = res.Substring(0, res.Length - 2) + "),";
            }
            return res;
        }
开发者ID:EruRorato,项目名称:InternetTech,代码行数:36,代码来源:Form1.cs

示例9: ProcessMonitoring

        public static async void ProcessMonitoring(TextBox usageTextBox, TextBox listTextBox)
        {
            int changed = ProcessCounter;
            string[] data;
            while (true)
            {
                await Task.Delay(1000);
                CurrentNumberProcesses();
                usageTextBox.Invoke(new Action(() =>
                {
                    usageTextBox.Text = ProcessCounter + "";
                }));

                if (changed != ProcessCounter)
                {
                    changed = ProcessCounter;
                    listTextBox.Invoke(new Action(() =>
                    {
                        data = ReadProcesses();

                        foreach (string pData in data)
                        {
                            if (listTextBox.Text.Length < 0)
                                listTextBox.Text = pData;
                            else
                                listTextBox.AppendText($"\r\n{pData}");
                        }
                    }));
                }
            }
        }
开发者ID:MikeHardman,项目名称:acIDS,代码行数:31,代码来源:ProcessMonitor.cs

示例10: ScriptChecks

        static public void ScriptChecks(ref TextBox textbox, ref ToolStripProgressBar ProgressBar)
		{
			string[] src = FileSystemUtil.GetAllFileNames((string)Settings.Global.Properties["POLPath"], "*.src");
			string[] ecl = FileSystemUtil.GetAllFileNames((string)Settings.Global.Properties["POLPath"], "*.ecl");
            string[] asp = FileSystemUtil.GetAllFileNames((string)Settings.Global.Properties["POLPath"], "*.asp");

            ScriptCount.Add("ECL", ecl.Length);
            ScriptCount.Add("SRC", src.Length);
            ScriptCount.Add("ASP", asp.Length);

			if (ecl.Length < src.Length)
				textbox.AppendText("* Warning: Not all scripts are compiled." + Environment.NewLine);
			else if (ecl.Length > src.Length)
				textbox.AppendText("* Warning: There are more ecl files than src files." + Environment.NewLine);
			else
				textbox.AppendText("* Pass: All scripts are compiled." + Environment.NewLine);
			textbox.AppendText("Found " + src.Length.ToString() + " .src files and " + ecl.Length.ToString() + " .ecl files." + Environment.NewLine);
            ProgressBar.PerformStep();
		}
开发者ID:polserver,项目名称:poltools,代码行数:19,代码来源:POLChecks.cs

示例11: add_text

 public static void add_text(TextBox tb, object s)
 {
     if (tb.InvokeRequired)
         tb.Invoke(new Action<TextBox, object>(add_text), new object[] { tb, s });
     else
     {
         tb.AppendText(s.ToString());
         tb.ScrollToCaret();
     }
 }
开发者ID:HowieXue,项目名称:Hospital_projs,代码行数:10,代码来源:Helper.cs

示例12: ConnectToHopper

        public void ConnectToHopper(TextBox log = null)
        {
            // setup timer
            System.Windows.Forms.Timer reconnectionTimer = new System.Windows.Forms.Timer();
            reconnectionTimer.Tick += new EventHandler(reconnectionTimer_Tick);
            reconnectionTimer.Interval = 1000; // ms
            int attempts = 10;

            // Setup connection info
            Hopper.CommandStructure.ComPort = Global.ComPort;
            Hopper.CommandStructure.SSPAddress = Global.Validator2SSPAddress;
            Hopper.CommandStructure.BaudRate = 9600;
            Hopper.CommandStructure.Timeout = 1000;
            Hopper.CommandStructure.RetryLevel = 3;

            // Run for number of attempts specified
            for (int i = 0; i < attempts; i++)
            {
                if (log != null) log.AppendText("Trying connection to SMART Hopper\r\n");

                // turn encryption off for first stage
                Hopper.CommandStructure.EncryptionStatus = false;

                // if the key negotiation is successful then set the rest up
                if (Hopper.OpenPort() && Hopper.NegotiateKeys(log))
                {
                    Hopper.CommandStructure.EncryptionStatus = true; // now encrypting
                    // find the max protocol version this validator supports
                    byte maxPVersion = FindMaxHopperProtocolVersion();
                    if (maxPVersion >= 6)
                        Hopper.SetProtocolVersion(maxPVersion, log);
                    else
                    {
                        MessageBox.Show("This program does not support slaves under protocol 6!", "ERROR");
                        return;
                    }
                    // get info from the validator and store useful vars
                    Hopper.SetupRequest(log);
                    // inhibits, this sets which channels can receive notes
                    Hopper.SetInhibits(log);
                    // set running to true so the hopper begins getting polled
                    hopperRunning = true;
                    return;
                }
                // reset timer
                reconnectionTimer.Enabled = true;
                while (reconnectionTimer.Enabled)
                {
                    if (CHelpers.Shutdown)
                        return;
                    Application.DoEvents();
                }
            }
        }
开发者ID:jjaaddiicc,项目名称:stserver,代码行数:54,代码来源:Form1.cs

示例13: AppendText

 private void AppendText(TextBox txtBox, String txt)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new DelegateAppendText(AppendText), new object[] { txtBox, txt });
     }
     else
     {
         txtBox.AppendText(txt);
     }
 }
开发者ID:jionfull,项目名称:SensorTst,代码行数:11,代码来源:FormBoardFuncSet(冲突_CHINA-PC_2012-12-03+16-42-25).cs

示例14: AppendText

 public void AppendText(TextBox ctl, string txt)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new DelegateShowText(AppendText), new object[] { ctl, txt });
     }
     else
     {
         ctl.AppendText(txt);
     }
 }
开发者ID:jionfull,项目名称:LonUI,代码行数:11,代码来源:FormOut.cs

示例15: SetTextBoxValue

 private void SetTextBoxValue(string value, TextBox ctr)
 {
     Action<string> setValueAction = text => ctr.AppendText(value);//Action<T>本身就是delegate类型,省掉了delegate的定义
     if (ctr.InvokeRequired)
     {
         ctr.Invoke(setValueAction, value);
     }
     else
     {
         setValueAction(value);
     }
 }
开发者ID:caocf,项目名称:workspace-kepler,代码行数:12,代码来源:UCServiceRunLog.cs


注:本文中的System.Windows.Forms.TextBox.AppendText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。