本文整理汇总了C#中SetTextCallback类的典型用法代码示例。如果您正苦于以下问题:C# SetTextCallback类的具体用法?C# SetTextCallback怎么用?C# SetTextCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SetTextCallback类属于命名空间,在下文中一共展示了SetTextCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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();
}
}
示例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
}
}
}
}
示例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;
}
}
}
示例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();
}
}
示例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;
}
}
示例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 });
}
}
示例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;
}
}
示例9: SetText
private void SetText(string text) {
if (textBox1.InvokeRequired) {
var d = new SetTextCallback(SetText);
Invoke(d, new object[] { text });
}
else {
textBox1.AppendText(text);
}
}
示例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;
}
示例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;
}
}
示例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);
}
}
示例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 });
}
}
示例14: SetStatus
private void SetStatus(string status)
{
if (lblStatus.InvokeRequired)
{
SetTextCallback d = new SetTextCallback(SetStatus);
Invoke(d, new object[] { status });
}
else
lblStatus.Text = status;
}
示例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);
}