.Invoke (delegate)

J

jayderk

Hello all,
I have looked at articals such as
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
tml/BackgroundProcess.asp?frame=true

and

http://groups.google.com/groups?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&frame=rig
ht&th=dd95b146feb96bd4&seekm=e8YoIORzCHA.2696%40TK2MSFTNGP09#link1

to try and find an answer to my problems.

I have a control on a form (combo box)

I create a polling thread from the form and when a certain event happens I
want to re-populate..
I have verified all of the code works accept other then being called from
the polling thread.
I looked in chapter 20 of the core ref. it says to use delegate with invoke
but I can not get that to work either..


// declared
private delegate void mydelegate();

//code for the form such as got focus.. yada yada


pollingFunction(){
blah.. blah..
this.Invoke(new mydelegate(LoadCombo));
}



Please advise.

regards,
Jay
 
A

Alex Feinman [MVP]

try replacing
this.Invoke(new mydelegate(LoadCombo));
with
this.Invoke(new EventHandler(LoadCombo));

Also change the LoadCombo definition to be:

void LoadCombo(object sender, EventArgs e)
 
J

jayderk

I tried this with no success. it still has the same behavior. once down to
this line of code it just stops.

any other suggestions would be great.
thanks,
Jay
 
A

Alex Feinman [MVP]

There are no other suggestions. It should work, or the problem is elsewhere.
Perhaps you want to post few lines of your code

jayderk said:
I tried this with no success. it still has the same behavior. once down to
this line of code it just stops.

any other suggestions would be great.
thanks,
Jay



Alex Feinman said:
try replacing
this.Invoke(new mydelegate(LoadCombo));
with
this.Invoke(new EventHandler(LoadCombo));

Also change the LoadCombo definition to be:

void LoadCombo(object sender, EventArgs e)
http://msdn.microsoft.com/library/d...?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&frame=rig happens
 
J

jayderk

I am trying to get a datagrid on a form to repopulate when a certain event
occurs on a polling thread for a comm unit.
I have verified the code... and it all works accept for repopulating the
datagrid.

here is the other functions and declares

public class frmOrders: Yada Yada
{
private EventHandler myDelegate; // predefined delegate

public frmOrders(){
//
// Required for Windows Form Designer support
//
InitializeComponent();
// delegate instance to invoke
myDelegate = new EventHandler(LoadGrid);

..
..
..



private void LoadGrid(object sender,EventArgs e)
{
DataRow newRow;
myDataTable.Clear();
if(!grid_needs_to_be_loaded ||
valid_orders == null || valid_orders.Count <= 0)
return;

grid_needs_to_be_loaded = false;
foreach(ClipOrderObj order in valid_orders)
{
newRow = myDataTable.NewRow();
newRow["Description"] = order.Order_Desc.ToString();
newRow["Quantity"] = order.Order_Quantity;
myDataTable.Rows.Add(newRow);
}
}


this code works perfect. it does this.invoke(myDelegate).. goes to the
function, updates, and returns .. like it should

private void poll_function()
{
this.Invoke(myDelegate);
return;
}




this code does NOT work.. it gets down to this.Invoke(myDelegate) and locks
up.
Any suggestions would be great.

private void poll_function()
{
string COM_PORT = "COM8:\0";
string twoAsbyte = Convert.ToString((char)0x02);
bool comm_port_return = false;
// try
// {
// comm_port_return = Bluetooth.OpenCommPort(COM_PORT);
// }
// catch(Exception e)
// {
// MessageBox.Show("Could not open comm port\nMessage:" +
e.Message.ToString() );
// }

while(!terminate && !comm_port_return){
byte[] thebuff = new byte[100];
// try{thebuff = Bluetooth.ReadPortWord();}
// catch(Exception commex)
// {
// bool open_comm_try = Bluetooth.OpenCommPort(COM_PORT);
// continue;
// }

if(cboCustomer.SelectedIndex < 0)
{
Thread.Sleep(4000);
continue;
}
// if (thebuff[4] == 0)
// continue;
// string bufferData = Bluetooth.convertDllData(thebuff);
// string cleanBuffer = bufferData.Replace("\r\n"," ");
// string stringToSplit = cleanBuffer.Replace(twoAsbyte,"");

string[] goodData = new string[50];
goodData[0] = "11326812";
goodData[1] = "11326773";
goodData[2] = "11326804";
goodData[3] = "11326819";

// goodData = stringToSplit.Split(' ');
for(int i=0; i < goodData.Length-1; i++)
{
string mydata =
goodData.ToString().Trim().Substring(0,goodData.Length - 4);
if( mydata .Length <= 0)
continue;

int index = IsInCurrentOrder(mydata );

if( index >= 0 )
{// it is in the valid_list
last_row_hit = index;
}
else if( index == -1)
{// it is new
ClipOrderObj orderRec = new ClipOrderObj();
orderRec.Code = mydata;
cm.GetProductInformation(orderRec);
if(orderRec.Order_Desc.Length <= 0)
{
MessageBox.Show(barcode + " is not in current database","Item
Not found",

MessageBoxButtons.OK,MessageBoxIcon.Hand,MessageBoxDefaultButton.Button1);
continue;
}

orderRec.Customer_Id =
((CustomerInfo)customer_list[cboCustomer.SelectedIndex]).Customer_Id.ToStrin
g();
orderRec.Order_Quantity = 1;
orderRec.Order_Status = "N";
valid_orders.Add(orderRec);
}
}

grid_needs_to_be_loaded = true;


this.Invoke(myDelegate);

}
 
D

David Wrighton [MS]

I don't see any specific reason for the code posted down below to not
function, but as it isn't a complete example I can not investigate more.
However, the code does have a few problems. It does perform gui operations
from a thread other than the main gui thread. I noticed
ComboBox.SelectedIndex and the MessageBox showing code. I do not believe
either of these calls will trigger a lockup, but there are any number of
other gui operations that will deadlock. V1 of the .NET Compact Framework
only supports gui operations that occur on 1 thread and 1 thread only.

David Wrighton
..NET Compact Framework

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "jayderk" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: .Invoke (delegate)
| Date: Tue, 16 Sep 2003 14:03:34 -0500
| Lines: 249
| Organization: n/a
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: 209.150.197.226
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:33506
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I am trying to get a datagrid on a form to repopulate when a certain event
| occurs on a polling thread for a comm unit.
| I have verified the code... and it all works accept for repopulating the
| datagrid.
|
| here is the other functions and declares
|
| public class frmOrders: Yada Yada
| {
| private EventHandler myDelegate; // predefined delegate
|
| public frmOrders(){
| //
| // Required for Windows Form Designer support
| //
| InitializeComponent();
| // delegate instance to invoke
| myDelegate = new EventHandler(LoadGrid);
|
| .
| .
| .
|
|
|
| private void LoadGrid(object sender,EventArgs e)
| {
| DataRow newRow;
| myDataTable.Clear();
| if(!grid_needs_to_be_loaded ||
| valid_orders == null || valid_orders.Count <= 0)
| return;
|
| grid_needs_to_be_loaded = false;
| foreach(ClipOrderObj order in valid_orders)
| {
| newRow = myDataTable.NewRow();
| newRow["Description"] = order.Order_Desc.ToString();
| newRow["Quantity"] = order.Order_Quantity;
| myDataTable.Rows.Add(newRow);
| }
| }
|
|
| this code works perfect. it does this.invoke(myDelegate).. goes to the
| function, updates, and returns .. like it should
|
| private void poll_function()
| {
| this.Invoke(myDelegate);
| return;
| }
|
|
|
|
| this code does NOT work.. it gets down to this.Invoke(myDelegate) and
locks
| up.
| Any suggestions would be great.
|
| private void poll_function()
| {
| string COM_PORT = "COM8:\0";
| string twoAsbyte = Convert.ToString((char)0x02);
| bool comm_port_return = false;
| // try
| // {
| // comm_port_return = Bluetooth.OpenCommPort(COM_PORT);
| // }
| // catch(Exception e)
| // {
| // MessageBox.Show("Could not open comm port\nMessage:" +
| e.Message.ToString() );
| // }
|
| while(!terminate && !comm_port_return){
| byte[] thebuff = new byte[100];
| // try{thebuff = Bluetooth.ReadPortWord();}
| // catch(Exception commex)
| // {
| // bool open_comm_try = Bluetooth.OpenCommPort(COM_PORT);
| // continue;
| // }
|
| if(cboCustomer.SelectedIndex < 0)
| {
| Thread.Sleep(4000);
| continue;
| }
| // if (thebuff[4] == 0)
| // continue;
| // string bufferData = Bluetooth.convertDllData(thebuff);
| // string cleanBuffer = bufferData.Replace("\r\n"," ");
| // string stringToSplit = cleanBuffer.Replace(twoAsbyte,"");
|
| string[] goodData = new string[50];
| goodData[0] = "11326812";
| goodData[1] = "11326773";
| goodData[2] = "11326804";
| goodData[3] = "11326819";
|
| // goodData = stringToSplit.Split(' ');
| for(int i=0; i < goodData.Length-1; i++)
| {
| string mydata =
| goodData.ToString().Trim().Substring(0,goodData.Length - 4);
| if( mydata .Length <= 0)
| continue;
|
| int index = IsInCurrentOrder(mydata );
|
| if( index >= 0 )
| {// it is in the valid_list
| last_row_hit = index;
| }
| else if( index == -1)
| {// it is new
| ClipOrderObj orderRec = new ClipOrderObj();
| orderRec.Code = mydata;
| cm.GetProductInformation(orderRec);
| if(orderRec.Order_Desc.Length <= 0)
| {
| MessageBox.Show(barcode + " is not in current database","Item
| Not found",
|
| MessageBoxButtons.OK,MessageBoxIcon.Hand,MessageBoxDefaultButton.Button1);
| continue;
| }
|
| orderRec.Customer_Id =
|
((CustomerInfo)customer_list[cboCustomer.SelectedIndex]).Customer_Id.ToStrin
| g();
| orderRec.Order_Quantity = 1;
| orderRec.Order_Status = "N";
| valid_orders.Add(orderRec);
| }
| }
|
| grid_needs_to_be_loaded = true;
|
|
| this.Invoke(myDelegate);
|
| }
|
|
|
|
|
|
|
|
|
|
|
|
| | > There are no other suggestions. It should work, or the problem is
| elsewhere.
| > Perhaps you want to post few lines of your code
| >
| > | > > I tried this with no success. it still has the same behavior. once
down
| to
| > > this line of code it just stops.
| > >
| > > any other suggestions would be great.
| > > thanks,
| > > Jay
| > >
| > >
| > >
| > > | > > > try replacing
| > > > this.Invoke(new mydelegate(LoadCombo));
| > > > with
| > > > this.Invoke(new EventHandler(LoadCombo));
| > > >
| > > > Also change the LoadCombo definition to be:
| > > >
| > > > void LoadCombo(object sender, EventArgs e)
| > > >
| > > >
| > > > | > > > > Hello all,
| > > > > I have looked at articals such as
| > > > >
| > > >
| > >
| >
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
| > > > > tml/BackgroundProcess.asp?frame=true
| > > > >
| > > > > and
| > > > >
| > > > >
| > > >
| > >
| >
|
http://groups.google.com/groups?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&frame=rig
| > > > > ht&th=dd95b146feb96bd4&seekm=e8YoIORzCHA.2696%40TK2MSFTNGP09#link1
| > > > >
| > > > > to try and find an answer to my problems.
| > > > >
| > > > > I have a control on a form (combo box)
| > > > >
| > > > > I create a polling thread from the form and when a certain event
| > happens
| > > I
| > > > > want to re-populate..
| > > > > I have verified all of the code works accept other then being
called
| > > from
| > > > > the polling thread.
| > > > > I looked in chapter 20 of the core ref. it says to use delegate
with
| > > > invoke
| > > > > but I can not get that to work either..
| > > > >
| > > > >
| > > > > // declared
| > > > > private delegate void mydelegate();
| > > > >
| > > > > //code for the form such as got focus.. yada yada
| > > > >
| > > > >
| > > > > pollingFunction(){
| > > > > blah.. blah..
| > > > > this.Invoke(new mydelegate(LoadCombo));
| > > > > }
| > > > >
| > > > >
| > > > >
| > > > > Please advise.
| > > > >
| > > > > regards,
| > > > > Jay
| > > > >
| > > > >
| > > >
| > > >
| > >
| > >
| >
| >
|
|
|
 
J

jayderk

the example above does populate the cboBox if I call it as soon as I enter
the polling loop.
like this example.
--------------------------------------------------------------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;



namespace SmartDeviceApplication1
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu1;



private System.Windows.Forms.Label label1;
private System.Windows.Forms.DataGrid dtaOrder;

private DataSet myDataSet;
private DataTable myDataTable = new DataTable();

private bool grid_needs_to_be_loaded = false;
private int last_row_hit = -1;
private string strValue = "";
private string strValue2 = "";


ThreadStart workingThread;
Thread pollingThread;


private EventHandler myDelegate; // predefined delegate type

public Form1()
{
InitializeComponent();
// delegate instance to invoke
myDelegate = new EventHandler(LoadGrid);



MakeDataSet();
myDataTable = myDataSet.Tables["orders"];
dtaOrder.DataSource = myDataTable;


workingThread = new ThreadStart(poll_function);
pollingThread = new Thread(workingThread);
pollingThread.Start();

}

private void MakeDataSet()
{
myDataSet = new DataSet("myDataSet");
DataTable tCust = new DataTable("orders");

DataColumn colDESC = new DataColumn("Description");
DataColumn colQTY = new DataColumn("Quantity");
tCust.Columns.Add(colDESC);
tCust.Columns.Add(colQTY);

myDataSet.Tables.Add(tCust);


// data Grid style
DataGridTableStyle ts = new DataGridTableStyle();
ts.MappingName = "orders";
DataGridColumnStyle DescColStyle = new DataGridTextBoxColumn();
DescColStyle.MappingName = "Description";
DescColStyle.HeaderText = "Description";
DescColStyle.Width = 180;
ts.GridColumnStyles.Add(DescColStyle);


DataGridColumnStyle QtyColStyle = new DataGridTextBoxColumn();
QtyColStyle.MappingName = "Quantity";
QtyColStyle.HeaderText = "Qty";
QtyColStyle.Width = 34;
ts.GridColumnStyles.Add(QtyColStyle);

dtaOrder.TableStyles.Add(ts);
myDataTable = tCust;
}
private void LoadGrid(object sender,EventArgs e)
{
DataRow newRow;
//myDataTable.Clear();

if(!grid_needs_to_be_loaded)
return;

//grid_needs_to_be_loaded = false;

newRow = myDataTable.NewRow();
newRow["Description"] = strValue;
newRow["Quantity"] = strValue2;
myDataTable.Rows.Add(newRow);
}



/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.dtaOrder = new System.Windows.Forms.DataGrid();
//
// label1
//
this.label1.Text = "label1";
//
// dtaOrder
//
this.dtaOrder.Location = new System.Drawing.Point(24, 56);
this.dtaOrder.Size = new System.Drawing.Size(192, 152);
//
// Form1
//
this.Controls.Add(this.dtaOrder);
this.Controls.Add(this.label1);
this.Text = "Form1";

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>

static void Main()
{
Application.Run(new Form1());
}


private void poll_function()
{

grid_needs_to_be_loaded = true;

for(int i = 0; i < 5; i++)
{
strValue = "Bla " + i.ToString();
strValue2 = i.ToString();

this.Invoke(myDelegate);
}



}
}
}

---------------------------------------------------------------------------


David Wrighton said:
I don't see any specific reason for the code posted down below to not
function, but as it isn't a complete example I can not investigate more.
However, the code does have a few problems. It does perform gui operations
from a thread other than the main gui thread. I noticed
ComboBox.SelectedIndex and the MessageBox showing code. I do not believe
either of these calls will trigger a lockup, but there are any number of
other gui operations that will deadlock. V1 of the .NET Compact Framework
only supports gui operations that occur on 1 thread and 1 thread only.

David Wrighton
NET Compact Framework

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "jayderk" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: .Invoke (delegate)
| Date: Tue, 16 Sep 2003 14:03:34 -0500
| Lines: 249
| Organization: n/a
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: 209.150.197.226
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.dotnet.framework.compactframework:33506
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I am trying to get a datagrid on a form to repopulate when a certain event
| occurs on a polling thread for a comm unit.
| I have verified the code... and it all works accept for repopulating the
| datagrid.
|
| here is the other functions and declares
|
| public class frmOrders: Yada Yada
| {
| private EventHandler myDelegate; // predefined delegate
|
| public frmOrders(){
| //
| // Required for Windows Form Designer support
| //
| InitializeComponent();
| // delegate instance to invoke
| myDelegate = new EventHandler(LoadGrid);
|
| .
| .
| .
|
|
|
| private void LoadGrid(object sender,EventArgs e)
| {
| DataRow newRow;
| myDataTable.Clear();
| if(!grid_needs_to_be_loaded ||
| valid_orders == null || valid_orders.Count <= 0)
| return;
|
| grid_needs_to_be_loaded = false;
| foreach(ClipOrderObj order in valid_orders)
| {
| newRow = myDataTable.NewRow();
| newRow["Description"] = order.Order_Desc.ToString();
| newRow["Quantity"] = order.Order_Quantity;
| myDataTable.Rows.Add(newRow);
| }
| }
|
|
| this code works perfect. it does this.invoke(myDelegate).. goes to the
| function, updates, and returns .. like it should
|
| private void poll_function()
| {
| this.Invoke(myDelegate);
| return;
| }
|
|
|
|
| this code does NOT work.. it gets down to this.Invoke(myDelegate) and
locks
| up.
| Any suggestions would be great.
|
| private void poll_function()
| {
| string COM_PORT = "COM8:\0";
| string twoAsbyte = Convert.ToString((char)0x02);
| bool comm_port_return = false;
| // try
| // {
| // comm_port_return = Bluetooth.OpenCommPort(COM_PORT);
| // }
| // catch(Exception e)
| // {
| // MessageBox.Show("Could not open comm port\nMessage:" +
| e.Message.ToString() );
| // }
|
| while(!terminate && !comm_port_return){
| byte[] thebuff = new byte[100];
| // try{thebuff = Bluetooth.ReadPortWord();}
| // catch(Exception commex)
| // {
| // bool open_comm_try = Bluetooth.OpenCommPort(COM_PORT);
| // continue;
| // }
|
| if(cboCustomer.SelectedIndex < 0)
| {
| Thread.Sleep(4000);
| continue;
| }
| // if (thebuff[4] == 0)
| // continue;
| // string bufferData = Bluetooth.convertDllData(thebuff);
| // string cleanBuffer = bufferData.Replace("\r\n"," ");
| // string stringToSplit = cleanBuffer.Replace(twoAsbyte,"");
|
| string[] goodData = new string[50];
| goodData[0] = "11326812";
| goodData[1] = "11326773";
| goodData[2] = "11326804";
| goodData[3] = "11326819";
|
| // goodData = stringToSplit.Split(' ');
| for(int i=0; i < goodData.Length-1; i++)
| {
| string mydata =
| goodData.ToString().Trim().Substring(0,goodData.Length - 4);
| if( mydata .Length <= 0)
| continue;
|
| int index = IsInCurrentOrder(mydata );
|
| if( index >= 0 )
| {// it is in the valid_list
| last_row_hit = index;
| }
| else if( index == -1)
| {// it is new
| ClipOrderObj orderRec = new ClipOrderObj();
| orderRec.Code = mydata;
| cm.GetProductInformation(orderRec);
| if(orderRec.Order_Desc.Length <= 0)
| {
| MessageBox.Show(barcode + " is not in current database","Item
| Not found",
|
| MessageBoxButtons.OK,MessageBoxIcon.Hand,MessageBoxDefaultButton.Button1);
| continue;
| }
|
| orderRec.Customer_Id =
|
((CustomerInfo)customer_list[cboCustomer.SelectedIndex]).Customer_Id.ToStrin
| g();
| orderRec.Order_Quantity = 1;
| orderRec.Order_Status = "N";
| valid_orders.Add(orderRec);
| }
| }
|
| grid_needs_to_be_loaded = true;
|
|
| this.Invoke(myDelegate);
|
| }
|
|
|
|
|
|
|
|
|
|
|
|
| | > There are no other suggestions. It should work, or the problem is
| elsewhere.
| > Perhaps you want to post few lines of your code
| >
| > | > > I tried this with no success. it still has the same behavior. once
down
| to
| > > this line of code it just stops.
| > >
| > > any other suggestions would be great.
| > > thanks,
| > > Jay
| > >
| > >
| > >
| > > | > > > try replacing
| > > > this.Invoke(new mydelegate(LoadCombo));
| > > > with
| > > > this.Invoke(new EventHandler(LoadCombo));
| > > >
| > > > Also change the LoadCombo definition to be:
| > > >
| > > > void LoadCombo(object sender, EventArgs e)
| > > >
| > > >
| > > > | > > > > Hello all,
| > > > > I have looked at articals such as
| > > > >
| > > >
| > >
| >
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
| > > > > tml/BackgroundProcess.asp?frame=true
| > > > >
| > > > > and
| > > > >
| > > > >
| > > >
| > >
| >
|
http://groups.google.com/groups?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&frame=rig
| > > > > ht&th=dd95b146feb96bd4&seekm=e8YoIORzCHA.2696%40TK2MSFTNGP09#link1
| > > > >
| > > > > to try and find an answer to my problems.
| > > > >
| > > > > I have a control on a form (combo box)
| > > > >
| > > > > I create a polling thread from the form and when a certain event
| > happens
| > > I
| > > > > want to re-populate..
| > > > > I have verified all of the code works accept other then being
called
| > > from
| > > > > the polling thread.
| > > > > I looked in chapter 20 of the core ref. it says to use delegate
with
| > > > invoke
| > > > > but I can not get that to work either..
| > > > >
| > > > >
| > > > > // declared
| > > > > private delegate void mydelegate();
| > > > >
| > > > > //code for the form such as got focus.. yada yada
| > > > >
| > > > >
| > > > > pollingFunction(){
| > > > > blah.. blah..
| > > > > this.Invoke(new mydelegate(LoadCombo));
| > > > > }
| > > > >
| > > > >
| > > > >
| > > > > Please advise.
| > > > >
| > > > > regards,
| > > > > Jay
| > > > >
| > > > >
| > > >
| > > >
| > >
| > >
| >
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top