本文整理汇总了C#中SetTextCallback类的典型用法代码示例。如果您正苦于以下问题:C# SetTextCallback类的具体用法?C# SetTextCallback怎么用?C# SetTextCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SetTextCallback类属于命名空间,在下文中一共展示了SetTextCallback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UpdateMouse
public void UpdateMouse()
{
if (this.m_Windows[0].InvokeRequired)
{
SetTextCallback d = new SetTextCallback(UpdateMouse);
this.m_Windows[0].Invoke(d, new object[] { });
}
else
{
//Position.X = (float)m_Windows[0].Location.X;
//Position.Y = (float)m_Windows[0].Location.Y;
//Direction.X = (Cursor.Position.X + 10) - Position.X;
//Direction.Y = (Cursor.Position.Y + 10) - Position.Y;
//float length = (float)Math.Sqrt(Math.Pow(Direction.X, 2) + Math.Pow(Direction.Y, 2));
//if (length != 0)
//{
// Direction.X = Direction.X / length;
// Direction.Y = Direction.Y / length;
//}
//Position.X += Direction.X * Speed;
//Position.Y += Direction.Y * Speed;
//m_Windows[0].Location = new Point((int)Position.X, (int)Position.Y);
m_Windows[0].Location = new Point(Cursor.Position.X + 10, Cursor.Position.Y + 10);
m_Windows.Add(m_Windows[0]);
m_Windows.RemoveAt(0);
}
}
开发者ID:drsoxen,项目名称:Glitter-Trail,代码行数:33,代码来源:Manager.cs
示例2: SetText
private void SetText()
{
if (UpTxt.InvokeRequired)
{
updateDelegate = new SetTextCallback(SetText);
try
{
Invoke(updateDelegate);
}
catch (System.ObjectDisposedException e)
{
Console.WriteLine("Caught exception: " + e.StackTrace);
}
}
else
{
NET.Lock.WaitOne();
float sumU = 0;
float sumD = 0;
foreach(NetworkAdapter adapter in NET.NetworkAdapters){
if (adapter.PhysicalAdapter)
{
sumU += adapter.KBSSentFloat;
sumD += adapter.KBSRecievedFloat;
}
}
UpTxt.Text = sumU.ToString("0.00 KB/s");
DownTxt.Text = sumD.ToString("0.00 KB/s");
NET.Lock.Release();
}
}
开发者ID:Kriogen777,项目名称:Otil,代码行数:32,代码来源:NETSummary.cs
示例3: plotData
public void plotData(double data)
{
if (arduino.IsOpen)
{
if (this.chart1.InvokeRequired == true)
{
SetTextCallback d = new SetTextCallback(plotData);
this.Invoke(d, new object[] { data });
}
else
{
if (data < 100)
{
this.chart1.Series[0].Points.Add(data);
this.textBox1.Text = Math.Round(data, 2).ToString();
this.chart1.Update();
}
else
{
// Do nothing
}
}
}
}
开发者ID:robojames,项目名称:Keithley-DMM,代码行数:27,代码来源:ArduinoCP.cs
示例4: Form_Display
public Form_Display()
{
delegte1 = new SetTextCallback(SetText1);
InitializeComponent();
btn_port.Text = "&Connect";
// add in the available com ports
foreach (string s in SerialPort.GetPortNames())
{
this.comboBox1.Items.Add(s);
}
if (comboBox1.Items.Count == 0)
{
comboBox1.Items.Add("NO PORT");
this.comboBox1.SelectedIndex = 0;
btn_port.Enabled = false;
comboBox1.Enabled = false;
}
else
{
try
{
this.comboBox1.SelectedIndex = Properties.Settings.Default.comport;
}
catch
{
this.comboBox1.SelectedIndex = 0;
}
}
}
开发者ID:garyStofer,项目名称:hygdisp,代码行数:33,代码来源:Form1.cs
示例5: SetText
private void SetText()
{
if (TimeHMTxt.InvokeRequired)
{
updateDelegate = new SetTextCallback(SetText);
try
{
Invoke(updateDelegate);
}
catch (System.ObjectDisposedException e)
{
Console.WriteLine("Caught exception: " + e.StackTrace);
}
}
else
{
Sys.Lock.WaitOne();
TimeHMTxt.Text = Sys.TimeHM;
TimeSTxt.Text = Sys.TimeS;
DateTxt.Text = Sys.Date;
DayTxt.Text = Sys.Day;
Sys.Lock.Release();
}
}
开发者ID:Kriogen777,项目名称:Otil,代码行数:25,代码来源:SystemSummary.cs
示例6: received
public void received(String data)
{
if (this.txtReceived.InvokeRequired) {// ���̲߳�������ʱ��Ҫ���ûص���ʽ
SetTextCallback d = new SetTextCallback(received);
this.Invoke(d, new object[] { data });
} else {
txtReceived.Text += "\r\n���� " + data;
}
}
开发者ID:washheart,项目名称:fastipc,代码行数:9,代码来源:Form1.cs
示例7: Proxy_Client_0x06DoubleClick
void Proxy_Client_0x06DoubleClick(UOProxy.Packets.FromClient._0x06DoubleClick e)
{
if (this.textBox1.InvokeRequired)
{
string text = e.Serial + "EUO: " + UOProxy.Helpers.Serial.IntToEUO(e.Serial);
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
}
开发者ID:Crwth,项目名称:UOnet,代码行数:9,代码来源:Form1.cs
示例8: SetText
/// <summary>
/// Threadsave Text Property setter
/// </summary>
/// <param name="control"></param>
/// <param name="text"></param>
public static void SetText(Control control, string text)
{
if(control.InvokeRequired) {
SetTextCallback d = new SetTextCallback(SetText);
control.Invoke(d, new object[] { control, text });
} else {
control.Text = text;
}
}
开发者ID:RaptorOne,项目名称:IronAHK,代码行数:14,代码来源:GUIInvokeHelper.cs
示例9: SetText
private void SetText(string text) {
if (textBox1.InvokeRequired) {
var d = new SetTextCallback(SetText);
Invoke(d, new object[] { text });
}
else {
textBox1.AppendText(text);
}
}
开发者ID:satr,项目名称:rvslite,代码行数:9,代码来源:MessengerEmulatorControl.cs
示例10: SetDebugText
public void SetDebugText( string text)
{
if (laDebug.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetDebugText);
this.Invoke(d, new object[] { text });
}
else
laDebug.Text = text;
}
开发者ID:ashgeo,项目名称:moovingearth,代码行数:10,代码来源:Form1.cs
示例11: changeButtons
protected virtual void changeButtons()
{
if (button_search.InvokeRequired) {
SetTextCallback d = new SetTextCallback(changeButtons);
button_search.Invoke(d, new object[] { });
} else {
button_search.Visible = true;
button_cancelSearch.Visible = false;
}
}
开发者ID:TheDizzler,项目名称:DJMixer,代码行数:10,代码来源:SongSearchForm.cs
示例12: Output
public void Output(string message)
{
if (this.messageLog.InvokeRequired) {
SetTextCallback d = new SetTextCallback(Output);
this.Invoke(d, new object[] { message });
}
else {
messageLog.Items.Add(message);
}
}
开发者ID:westre,项目名称:Rootstamp-Server-Daemon,代码行数:10,代码来源:MainForm.cs
示例13: MIDIMessageReceived
private void MIDIMessageReceived(object sender, MidiInMessageEventArgs e)
{
if (e.MidiEvent is NoteEvent)
{
this.Note = new NoteID(((NoteEvent)e.MidiEvent).NoteNumber+1);
SetTextCallback d = new SetTextCallback(SetPitchBoxText);
this.Invoke(d, new object[] { ((NoteEvent)e.MidiEvent).NoteName });
}
}
开发者ID:Samaed,项目名称:RockTheSound,代码行数:10,代码来源:ShortcutPopup.cs
示例14: SetStatus
private void SetStatus(string status)
{
if (lblStatus.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetStatus);
Invoke(d, new object[] { status });
}
else
lblStatus.Text = status;
}
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:10,代码来源:PleaseWait.cs
示例15: Form1
public Form1()
{
InitializeComponent();
setTextCallback = new SetTextCallback(mavLinkTextBoxSetText);
//setTextCallback = new SetTextCallback(SetText);
string[] theSerialPortNames = System.IO.Ports.SerialPort.GetPortNames();
comPortComboBox.Items.AddRange(theSerialPortNames);
comPortComboBox.Items.Add("TCP");
comPortComboBox.Items.Add("UDP");
baudRateComboBox.Items.AddRange(baudRates);
}
开发者ID:ExcaliburVT,项目名称:OculusFPV,代码行数:11,代码来源:Form1.cs
示例16: Error
public void Error(string message)
{
if (this.messageLog.InvokeRequired) {
SetTextCallback d = new SetTextCallback(Output);
this.Invoke(d, new object[] { message });
}
else {
messageLog.Items.Add("ERROR:: " + message);
messageLog.SelectedIndex = messageLog.Items.Count - 1;
}
}
开发者ID:westre,项目名称:Rootstamp-Server-Daemon,代码行数:11,代码来源:MainForm.cs
示例17: setGUIText
protected virtual void setGUIText()
{
if (label_NumResults.InvokeRequired) {
SetTextCallback d = new SetTextCallback(setGUIText);
label_NumResults.Invoke(d, new object[] { });
} else {
label_NumResults.Text = listBox_SearchResults.Items.Count + " Matches Found";
label_Timer.Text = "in " + timer.Elapsed.TotalSeconds + " seconds";
progressBar_Searching.Value = 100;
}
}
开发者ID:TheDizzler,项目名称:DJMixer,代码行数:11,代码来源:SongSearchForm.cs
示例18: IncrementProcess
public void IncrementProcess()
{
if (this.progressBar1.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(IncrementProcess);
this.Invoke(d, new object[] { });
}
else
{
dataGridView1.ClearSelection();
int numIndex = progressBar1.Value - 1;
if (this.progressBar1.Value < this.progressBar1.Maximum)
{
dataGridView1.Rows[progressBar1.Value].Selected = true;
this.progressBar1.Value += 1;
}
else
{
numIndex = progressBar1.Value - 1;
this.button1.Enabled = true;
this.comboBox1.Enabled = true;
}
this.lblTotal.Text = progressBar1.Value + " / " + progressBar1.Maximum;
try
{
dataGridView1.Rows[numIndex].ErrorText = Common.strMessage;
switch (Common.LastProcessResult)
{
case Common.ProcessResult.Processed:
dataGridView1.Rows[numIndex].DefaultCellStyle.BackColor = Color.Silver;
break;
case Common.ProcessResult.Ok1:
dataGridView1.Rows[numIndex].DefaultCellStyle.BackColor = Color.Yellow;
break;
case Common.ProcessResult.Ok2:
dataGridView1.Rows[numIndex].DefaultCellStyle.BackColor = Color.LightGreen;
break;
case Common.ProcessResult.Added:
dataGridView1.Rows[numIndex].DefaultCellStyle.BackColor = Color.LightBlue;
break;
case Common.ProcessResult.Error:
dataGridView1.Rows[numIndex].DefaultCellStyle.BackColor = Color.Orange;
break;
case Common.ProcessResult.Closed:
dataGridView1.Rows[numIndex].DefaultCellStyle.BackColor = Color.LightSalmon;
break;
}
//dataGridView1.Rows[numIndex].Selected = true;
}
catch (Exception)
{
}
}
}
开发者ID:HRicardo,项目名称:NetsuiteOnlineServicesOrders,代码行数:54,代码来源:Form1.cs
示例19: WriteLine
/// <summary>
/// Writes a line to the textbox. Automaticall adds newline character
/// </summary>
/// <param name="text"></param>
public void WriteLine(string text, ChatIcon icon = ChatIcon.Default)
{
if (tb.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(WriteLine);
try
{
tb.Parent.Invoke(d, new object[] { text, icon });
}
catch { }
}
else
{
Bitmap chatIcon = null;
switch (icon)
{
case ChatIcon.Sc2Tv:
chatIcon = Properties.Resources.sc2icon;
break;
case ChatIcon.TwitchTv:
chatIcon = Properties.Resources.twitchicon;
break;
case ChatIcon.Steam:
chatIcon = Properties.Resources.steamicon;
break;
case ChatIcon.Skype:
chatIcon = Properties.Resources.skypeicon;
break;
case ChatIcon.Admin:
chatIcon = Properties.Resources.adminicon;
break;
case ChatIcon.Goodgame:
chatIcon = Properties.Resources.goodgameicon;
break;
case ChatIcon.Battlelog:
chatIcon = Properties.Resources.bf3icon;
break;
default:
chatIcon = null;
break;
}
if( tb.Text.Length > 0 )
tb.AppendText(Environment.NewLine);
if (text != null)
{
tb.AppendText(DateTime.Now.GetDateTimeFormats('T')[0] + " ");
if(chatIcon != null)
tb.InsertImage( chatIcon );
tb.AppendText(" " + text);
}
tb.ScrollToEnd();
}
}
开发者ID:ByteSempai,项目名称:Ubiquitous,代码行数:58,代码来源:Log.cs
示例20: SKoreLabel
public SKoreLabel()
{
SetStyle((ControlStyles)2050, true);
DoubleBuffered = true;
BackColor = Color.White;
_setText = new SetTextCallback(SetText);
_animateTimer = new System.Timers.Timer(_animationInterval);
_animateTimer.SynchronizingObject = this;
_animateTimer.Elapsed += DoAnimation;
}
开发者ID:SirJamal,项目名称:Sulakore,代码行数:12,代码来源:SKoreLabel.cs
注:本文中的SetTextCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论