Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
AnswerRe: My service must run my form Pin
Gonzoox4-Mar-10 3:35
Gonzoox4-Mar-10 3:35 
GeneralRe: My service must run my form Pin
Andy_R4-Mar-10 3:42
Andy_R4-Mar-10 3:42 
GeneralRe: My service must run my form Pin
Andy_R5-Mar-10 2:08
Andy_R5-Mar-10 2:08 
GeneralRe: My service must run my form Pin
Andy_R5-Mar-10 3:10
Andy_R5-Mar-10 3:10 
Questionparameter count mismatch listBox. Pin
arsendem4-Mar-10 2:30
arsendem4-Mar-10 2:30 
AnswerRe: parameter count mismatch listBox. Pin
Not Active4-Mar-10 3:04
mentorNot Active4-Mar-10 3:04 
AnswerMessage Closed Pin
4-Mar-10 3:05
stancrm4-Mar-10 3:05 
GeneralRe: parameter count mismatch listBox. Pin
arsendem4-Mar-10 3:20
arsendem4-Mar-10 3:20 
When I wish to use listBox1 in a thread gives out an error:
"Cross-thread operation not valid: Control 'listBox1' accessed from a thread other
than the thread it was created on.".


I badly understand delegates.

public delegate void ListBoxCallback(string s);
public void listBox_1_ItemsAdd(string value1)
{
ListBoxCallback callback = new ListBoxCallback(listBox_1_ItemsAdd);
Invoke(callback); // Here a problem: "parameter count mismatch"
listBox1.Items.Add(value1);
}

I transfer to a method listBox_1_ItemsAdd string value value1.
listBox_1_ItemsAdd(dataGridView1[2, i].Value.ToString());

Also, how to transfer parametre here.
private delegate void ChangeProgressBarCallback(int size);
public void changeProgressBar(int MaxSize)
{
if (progressBar1.InvokeRequired)
{
// instantiate the callback instance out of this very method
ChangeProgressBarCallback callback = new ChangeProgressBarCallback(changeProgressBar);
// invoke it, when it comes to it again InvokeRequired will be false
Invoke(callback);
}
else
{
progressBar1.Minimum = 0;
progressBar1.Maximum = MaxSize;
progressBar1.Step = 1;
for (int x = 1; x <= MaxSize; x++)
{
progressBar1.PerformStep();
}
}
}
How to transfer parametre in the delegate.
That I to do not so prompt pleaseConfused | :confused:
Questionappend to excel file c# !! Pin
noamtzu004-Mar-10 1:42
noamtzu004-Mar-10 1:42 
AnswerRe: append to excel file c# !! Pin
Not Active4-Mar-10 1:57
mentorNot Active4-Mar-10 1:57 
GeneralI know this, but more comfortable working with ..... Pin
noamtzu004-Mar-10 2:41
noamtzu004-Mar-10 2:41 
GeneralRe: I know this, but more comfortable working with ..... Pin
Not Active4-Mar-10 2:59
mentorNot Active4-Mar-10 2:59 
GeneralRe: I know this, but more comfortable working with ..... Pin
noamtzu004-Mar-10 7:16
noamtzu004-Mar-10 7:16 
GeneralRe: I know this, but more comfortable working with ..... Pin
Mirko19804-Mar-10 3:15
Mirko19804-Mar-10 3:15 
GeneralRe: I know this, but more comfortable working with ..... Pin
noamtzu004-Mar-10 7:15
noamtzu004-Mar-10 7:15 
GeneralRe: I know this, but more comfortable working with ..... Pin
Dave Kreskowiak4-Mar-10 3:45
mveDave Kreskowiak4-Mar-10 3:45 
GeneralRe: I know this, but more comfortable working with ..... Pin
noamtzu004-Mar-10 7:14
noamtzu004-Mar-10 7:14 
GeneralRe: I know this, but more comfortable working with ..... Pin
Dave Kreskowiak4-Mar-10 8:11
mveDave Kreskowiak4-Mar-10 8:11 
GeneralRe: I know this, but more comfortable working with ..... Pin
noamtzu004-Mar-10 8:24
noamtzu004-Mar-10 8:24 
QuestionHow to Enable/Disable local area network connection ? Pin
Dr.DigiTaL4-Mar-10 1:25
Dr.DigiTaL4-Mar-10 1:25 
AnswerRe: How to Enable/Disable local area network connection ? Pin
Rajesh R Subramanian4-Mar-10 1:43
professionalRajesh R Subramanian4-Mar-10 1:43 
QuestionSeting a References Pin
neverpleat4-Mar-10 0:50
neverpleat4-Mar-10 0:50 
AnswerREPOST Pin
Dave Kreskowiak4-Mar-10 1:56
mveDave Kreskowiak4-Mar-10 1:56 
Questionhow to detect new request in internet explorer using c#. Pin
junaidcodeproject3-Mar-10 23:44
junaidcodeproject3-Mar-10 23:44 
QuestionMicrosoft Exchange Address Book All Record C# Pin
asdxxxx3-Mar-10 22:53
asdxxxx3-Mar-10 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.