本文介绍了我想在asp.net web中使用c#text.invoke函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hii



i得到了奇怪的情况我将c#windows应用程序转换为基于aweb的应用程序,在代码中有一个名为 textbox.invoke的函数( )



用于多线程应用,据我了解



所以。 。在网上可以使用什么功能呢



 私人  void 日志(LogMsgType msgtype, string  msg)
{
rtfTerminal.Invoke( new EventHandler( delegate
{
rtfTerminal.SelectedText = string .Empty;
rtfTerminal.SelectionFont = new 字体(rtfTerminal.SelectionFont,FontStyle.Bold);
rtfTerminal .SelectionColor = LogMsgTypeColor [( int )msgtype];
rtfTerminal.AppendText(msg);
rtfTerminal.ScrollToCaret();
}));
}



rtfTerminal是一个文本框!

这是代码部分

thx

解决方案



hii

i got astrange situation iam converting c# windows application to aweb based application , inside the code there is function called textbox.invoke()

its for multithreading application as i understand

so .. what function can used in web like it

private void Log(LogMsgType msgtype, string msg)
    {
      rtfTerminal.Invoke(new EventHandler(delegate
      {
        rtfTerminal.SelectedText = string.Empty;
        rtfTerminal.SelectionFont = new Font(rtfTerminal.SelectionFont, FontStyle.Bold);
        rtfTerminal.SelectionColor = LogMsgTypeColor[(int)msgtype];
        rtfTerminal.AppendText(msg);
        rtfTerminal.ScrollToCaret();
      }));
    }


rtfTerminal is a textbox !
this is the code part
thx

解决方案



这篇关于我想在asp.net web中使用c#text.invoke函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 05:00