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


C# TextBox.Refresh方法代码示例

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


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

示例1: AddLogEntry

        public void AddLogEntry(string message,string thread)
        {
            if (!threadTabs.ContainsKey(thread))
            {

                TabPage tab = new TabPage();
                tab.Location = new System.Drawing.Point(4, 22);
                tab.Name = "tab" + thread.Trim().Replace(' ', '_');
                tab.Padding = new System.Windows.Forms.Padding(3);
                tab.Size = new System.Drawing.Size(859, 226);
                tab.Text = thread;
                tab.UseVisualStyleBackColor = true;
                threadTabs[thread] = tab;
                tabControl1.TabPages.Add(tab);

                TextBox txtLogBox = new TextBox();
                txtLogBox.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                txtLogBox.Location = new System.Drawing.Point(6, 6);
                txtLogBox.Multiline = true;
                txtLogBox.Name = "txtLogBox";
                txtLogBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
                txtLogBox.Size = new System.Drawing.Size(847, 214);
                txtLogBox.TabIndex = 1;
                tab.Controls.Add(txtLogBox);
                txtLogBox.Text += "[" + DateTime.Now.ToLongTimeString() + "] - " + message + Environment.NewLine;
                txtLogBox.SelectionStart = txtLogBox.Text.Length;
                txtLogBox.ScrollToCaret();
                txtLogBox.Refresh();
            }
            else
            {
                TabPage tab = threadTabs[thread];
                TextBox txtLogBox = (TextBox) tab.Controls[0];
                txtLogBox.Text += "[" + DateTime.Now.ToLongTimeString() + "] - " + message + Environment.NewLine;
                txtLogBox.SelectionStart = txtLogBox.Text.Length;
                txtLogBox.ScrollToCaret();
                txtLogBox.Refresh();
            }

            /*
            txtLogBox.Text += "[" + DateTime.Now.ToLongTimeString() + "] - " + message + Environment.NewLine;
            txtLogBox.SelectionStart = txtLogBox.Text.Length;
            txtLogBox.ScrollToCaret();
            txtLogBox.Refresh();
             */
        }
开发者ID:NoxHarmonium,项目名称:enform,代码行数:46,代码来源:LogBox.cs

示例2: CheckDateFormat

 private void CheckDateFormat(TextBox Box)
 {
     switch (Box.Text.Length)
     {
         case 2:
             Box.Text += ".";
             Box.SelectionStart = Box.TextLength;
             Box.ScrollToCaret();
             Box.Refresh();
             break;
         case 5:
             Box.Text += ".";
             Box.SelectionStart = Box.TextLength;
             Box.ScrollToCaret();
             Box.Refresh();
             break;
         case 10:
             DateTime Test = new DateTime();
             if (!DateTime.TryParse(Box.Text, out Test))
             {
                 AddProfileErrorProvider.SetError(Box, "Invalid date format \nThe date must be in the format (dd.mm.yyyy) \nand contain only numbers included in the date range");
             }
             else
             {
                 AddProfileErrorProvider.Clear();
             }
             break;
     }
 }
开发者ID:FreedomHex,项目名称:TDay,代码行数:29,代码来源:AddProfile.cs

示例3: TAC_CreateFontLibrary

 //将字体以指定像素画到屏幕上,再从屏幕上取点得到字体点阵信息
 //按照一定的顺序写入二进制文件,以此制成字库文件
 //写的有问题,还是得改一改
 private static void TAC_CreateFontLibrary(TextBox tbFont, int nFontHeight, int nFontWidth, int nLines, int nClos, String sFontName)
 {
     //直接产生GBK字库文件
     //这是在PC端用的
     Encoding GBK = Encoding.GetEncoding("GBK");
     int nPerWordByte = (nFontWidth + 7) / 8 * nFontHeight;
     int nPerPageByte = nPerWordByte * nLines * nClos;
     byte[] barWriteFontDataBuffer = new byte[nPerPageByte * 0x7e];
     byte[] GbkBytes = new byte[nLines * nClos * 2];
     int bufferOffeset = 0;
     for (int ch = 0x81; ch <= 0xfe; ch++)
     {
         int k = 0;
         for (int cl = 0x40; cl <= 0xff; cl++)
         {
             GbkBytes[k++] = (byte)ch;
             GbkBytes[k++] = (byte)cl;
         }
         byte[] RealGbkBytes = Encoding.Convert(GBK, Encoding.Default, GbkBytes);
         String strPageText = Encoding.Default.GetString(TAC_ReplaceQuesToDoubleBlank(RealGbkBytes));
         tbFont.Text = strPageText;
         tbFont.Refresh();
         byte[][] tbFontBitData = TAC_TurnTextBoxToPix(tbFont);
         byte[] temp = TAC_CutToGridAndTurnToByte(tbFontBitData, nFontHeight, nFontWidth, nLines, nClos);
         temp.CopyTo(barWriteFontDataBuffer, bufferOffeset);
         bufferOffeset += nPerPageByte;
     }
     FileStream wFileStream = new FileStream(sFontName, FileMode.Create);
     wFileStream.Write(barWriteFontDataBuffer, 0, barWriteFontDataBuffer.Length);
     wFileStream.Close();
 }
开发者ID:aircross,项目名称:vs-projects,代码行数:34,代码来源:TEXTANDPIC.cs

示例4: HELPER_updateTextBox

 /// <summary>
 /// Will update Text in a Text Box when the UI thread is still busy
 /// </summary>
 /// <param name="myTextBox">The TextBox control to update</param>
 /// <param name="myText">The Text to update</param>
 private void HELPER_updateTextBox(TextBox myTextBox, string myText)
 {
     myTextBox.Text = myText;
     myTextBox.Invalidate();
     myTextBox.Update();
     myTextBox.Refresh();
     Application.DoEvents();
 }
开发者ID:shuskey,项目名称:3DFamilyTreeFileUtility,代码行数:13,代码来源:SignInFormWizard.cs

示例5: ScrollTextBox

 /// <summary>
 /// Scrolls the text box.
 /// </summary>
 /// <param name="textBox">The text box.</param>
 private void ScrollTextBox(TextBox textBox)
 {
     textBox.SelectionStart = textBox.Text.Length;
     textBox.ScrollToCaret();
     textBox.Refresh();
 }
开发者ID:ptorchilov,项目名称:Computing-Complexes-Systems-and-Networks,代码行数:10,代码来源:Host.cs

示例6: AddResult

 private void AddResult(string Result, TextBox tbx_Target)
 {
     tbx_Target.Text += Result;
     tbx_Target.Text += "\r\n";
     tbx_Target.Focus();
     tbx_Target.Select(tbx_OBOM_Result.TextLength, 0);
     tbx_Target.ScrollToCaret();
     tbx_Target.Refresh();
 }
开发者ID:demonzhq,项目名称:JLR,代码行数:9,代码来源:BroadCastConvert.cs

示例7: UpdateConsole

        private void UpdateConsole(TextBox con,
            string message,
            params object[] args)
        {
            if (args == null)
                con.Text += message + "\r\n";
            else
                con.Text += String.Format(message, args) + "\r\n";

            con.SelectionStart = con.Text.Length;
            con.ScrollToCaret();
            con.Refresh();
        }
开发者ID:westleyl,项目名称:DDDNorth2-AsyncPatterns,代码行数:13,代码来源:AsyncPatternsAndPractices.cs

示例8: ClearConsole

 private void ClearConsole(TextBox con)
 {
     con.Text = String.Empty;
     con.Refresh();
 }
开发者ID:westleyl,项目名称:DDDNorth2-AsyncPatterns,代码行数:5,代码来源:AsyncPatternsAndPractices.cs


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