Click here to Skip to main content
15,350,014 members
Home / Discussions / C#
   

C#

 
QuestionQuartzTypeLib and subtitles Pin
audaijihad30-Sep-12 6:22
Memberaudaijihad30-Sep-12 6:22 
AnswerRe: QuartzTypeLib and subtitles Pin
Ravi Bhavnani30-Sep-12 6:47
professionalRavi Bhavnani30-Sep-12 6:47 
GeneralRe: QuartzTypeLib and subtitles Pin
audaijihad30-Sep-12 11:33
Memberaudaijihad30-Sep-12 11:33 
QuestionUpdating a Label in 2 forms simultaneously Pin
CSharpNewbie 229-Sep-12 21:37
MemberCSharpNewbie 229-Sep-12 21:37 
AnswerRe: Updating a Label in 2 forms simultaneously Pin
Smart Arab29-Sep-12 22:40
MemberSmart Arab29-Sep-12 22:40 
AnswerRe: Updating a Label in 2 forms simultaneously Pin
Dave Kreskowiak30-Sep-12 3:01
mveDave Kreskowiak30-Sep-12 3:01 
GeneralRe: Updating a Label in 2 forms simultaneously Pin
CSharpNewbie 230-Sep-12 12:20
MemberCSharpNewbie 230-Sep-12 12:20 
AnswerRe: Updating a Label in 2 forms simultaneously Pin
Emdad_54821-Oct-12 1:44
MemberEmdad_54821-Oct-12 1:44 
Hi,

create a global delegate so that the delegate can be access from both Form1 and Form2.
public delegate void LabelUpdateDel();

create an instance of the delegate in Form1.
public LabelUpdateDel lblUpdateDel;

I believe you are showing the Form2 from Form1.
so attach a Form1 method with the delegate before showing Form2.

Form2.lblUpdateDel=MethodUpdateLabel; // MethodUpdateLabel is in Form1.
Form2.Show();

private void MethodUpdateLabel ()
{
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(MethodUpdateLabel ));
}
else
{
lblForm1.Text = "your text";
}
}

Now the method DoSomeOperations() is look like

public void DoSomeOperations()
{
..
lblForm2.Text="Your text";
if(lblUpdateDel!=null)
{
lblUpdateDel();
}
}

thats all.
QuestionC# check for null in linq Pin
dcof29-Sep-12 9:05
Memberdcof29-Sep-12 9:05 
AnswerRe: C# check for null in linq Pin
Richard MacCutchan29-Sep-12 21:45
mveRichard MacCutchan29-Sep-12 21:45 
QuestionEncrypt text file in C# Pin
gibsray29-Sep-12 7:09
Membergibsray29-Sep-12 7:09 
AnswerRe: Encrypt text file in C# Pin
Smart Arab29-Sep-12 7:20
MemberSmart Arab29-Sep-12 7:20 
AnswerRe: Encrypt text file in C# Pin
Sandip.Nascar29-Sep-12 8:53
MemberSandip.Nascar29-Sep-12 8:53 
QuestionPattern for creating class libraries Pin
nitin_ion28-Sep-12 20:32
Membernitin_ion28-Sep-12 20:32 
AnswerRe: Pattern for creating class libraries Pin
n.podbielski28-Sep-12 21:51
Membern.podbielski28-Sep-12 21:51 
QuestionVisual Studio 10 Naming Issue? Pin
PDTUM28-Sep-12 9:57
MemberPDTUM28-Sep-12 9:57 
AnswerRe: Visual Studio 10 Naming Issue? Pin
Emmanuel Medina28-Sep-12 11:07
professionalEmmanuel Medina28-Sep-12 11:07 
GeneralRe: Visual Studio 10 Naming Issue? Pin
PDTUM28-Sep-12 13:31
MemberPDTUM28-Sep-12 13:31 
AnswerRe: Visual Studio 10 Naming Issue? Pin
Smart Arab28-Sep-12 22:20
MemberSmart Arab28-Sep-12 22:20 
GeneralRe: Visual Studio 10 Naming Issue? Pin
PDTUM3-Oct-12 5:25
MemberPDTUM3-Oct-12 5:25 
GeneralRe: Visual Studio 10 Naming Issue? Pin
Smart Arab3-Oct-12 7:01
MemberSmart Arab3-Oct-12 7:01 
QuestionC# database error Pin
classy_dog28-Sep-12 6:50
Memberclassy_dog28-Sep-12 6:50 
AnswerRe: C# database error Pin
Matt U.28-Sep-12 6:59
MemberMatt U.28-Sep-12 6:59 
AnswerRe: C# database error Pin
Emmanuel Medina28-Sep-12 9:40
professionalEmmanuel Medina28-Sep-12 9:40 
QuestionImage compression Pin
hardiksince198728-Sep-12 6:13
Memberhardiksince198728-Sep-12 6:13 

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.