Click here to Skip to main content
15,902,275 members
Home / Discussions / C#
   

C#

 
GeneralRe: Operator Precedence Pin
Wendelius15-Dec-08 7:24
mentorWendelius15-Dec-08 7:24 
GeneralPerpetuum mobile? Pin
Luc Pattyn15-Dec-08 7:09
sitebuilderLuc Pattyn15-Dec-08 7:09 
GeneralRe: Perpetuum mobile? Pin
Wendelius15-Dec-08 7:24
mentorWendelius15-Dec-08 7:24 
GeneralRe: OP? [modified] Pin
hotthoughtguy15-Dec-08 20:03
hotthoughtguy15-Dec-08 20:03 
GeneralRe: OP? Pin
Wendelius16-Dec-08 6:10
mentorWendelius16-Dec-08 6:10 
QuestionBackground worker thread Pin
Saamir15-Dec-08 4:28
Saamir15-Dec-08 4:28 
GeneralRe: Background worker thread Pin
Luc Pattyn15-Dec-08 4:35
sitebuilderLuc Pattyn15-Dec-08 4:35 
GeneralRe: Background worker thread Pin
Saamir15-Dec-08 4:49
Saamir15-Dec-08 4:49 
Here is my code. What I am trying to do is to allow the GUI not to be locked while waiting for the status from the signature capture unit.



private void cmdSign_Click(object sender, System.EventArgs e)
{
this.bgwSign.RunWorkerAsync();
if (SigStatus == 1)
{
cmdMgr.Enabled = true;
cmdSign.Enabled = true;
cmdCancel.Enabled = true;
cmdSign.Focus();
//Application.DoEvents();
}
else if (posSignature.GetVAR("btstate") == "btnCANCEL")
{
cmdMgr.Enabled = true;
cmdSign.Enabled = true;
cmdCancel.Enabled = true;
cmdSign.Focus();
SigStatus = 1;
}
else
{
cmdCancel.Enabled = true;
cmdMgr.Enabled = true;
cmdSign.Enabled = true;
cmdSign.Focus();
SigStatus = 1;
}
}


private void bgwSign_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
timer1.Interval = 60000;
timer2.Enabled = false;
timer2.Stop();
lblInstruction.Text = "Ask customer to sign the signature pad";
//this.Cursor = Cursors.WaitCursor;
cmdNext.Enabled = false;
cmdSign.Enabled = false;
cmdCancel.Enabled = false;
cmdMgr.Enabled = false;
posSignImage = null;
PboxSignature.Image = null;
try
{
//Application.DoEvents();
timer1.Enabled = true;
timer1.Start();

while (posSignature.GetVAR("btstate") != "btnENTER" || posSignature.GetVAR("btstate") != "btnCANCEL" || SigStatus == 0)
{
if (this.bgwSign.CancellationPending)
{
e.Cancel = true;
return;
}
this.bgwSign.ReportProgress(SigStatus, timer1.Interval);

System.Threading.Thread.Sleep(20);
if (posSignature.GetVAR("btstate") == "btnCANCEL" || posSignature.GetVAR("btstate") == "btnENTER" || SigStatus == 1)
{
timer1.Enabled = false;
timer1.Stop();
break;
}
}

}
catch (Exception ex)
{
SigStatus = 1;
//MessageBox.Show(this, "Error in capturing and saving user signature\n\n\n" + ex.Message);
cmdSign.Enabled = true;
cmdCancel.Enabled = true;
cmdMgr.Enabled = true;

}
finally
{
this.Cursor = Cursors.Default;
}
}

Sameer

GeneralRe: Background worker thread Pin
Luc Pattyn15-Dec-08 5:33
sitebuilderLuc Pattyn15-Dec-08 5:33 
GeneralRe: Background worker thread Pin
Saamir15-Dec-08 6:19
Saamir15-Dec-08 6:19 
GeneralRe: Background worker thread Pin
Luc Pattyn15-Dec-08 6:40
sitebuilderLuc Pattyn15-Dec-08 6:40 
GeneralRe: Background worker thread Pin
#realJSOP15-Dec-08 6:06
professional#realJSOP15-Dec-08 6:06 
GeneralRe: Background worker thread Pin
Saamir15-Dec-08 6:17
Saamir15-Dec-08 6:17 
GeneralRe: Background worker thread Pin
#realJSOP15-Dec-08 6:18
professional#realJSOP15-Dec-08 6:18 
GeneralRe: Background worker thread Pin
Saamir15-Dec-08 6:20
Saamir15-Dec-08 6:20 
AnswerRe: Background worker thread Pin
Lev Danielyan15-Dec-08 4:37
Lev Danielyan15-Dec-08 4:37 
QuestionMultiple "dot". How to? Not sure what is it called. Pin
xav9915-Dec-08 3:45
xav9915-Dec-08 3:45 
AnswerRe: Multiple "dot". How to? Not sure what is it called. Pin
J4amieC15-Dec-08 4:06
J4amieC15-Dec-08 4:06 
GeneralRe: Multiple "dot". How to? Not sure what is it called. Pin
xav9915-Dec-08 14:28
xav9915-Dec-08 14:28 
AnswerRe: Multiple "dot". How to? Not sure what is it called. Pin
carbon_golem15-Dec-08 4:18
carbon_golem15-Dec-08 4:18 
AnswerRe: Multiple "dot". How to? Not sure what is it called. Pin
Paddy Boyd15-Dec-08 4:46
Paddy Boyd15-Dec-08 4:46 
Questionknowing the frame work is installed or not Pin
shavil15-Dec-08 3:32
shavil15-Dec-08 3:32 
AnswerRe: knowing the frame work is installed or not Pin
N a v a n e e t h15-Dec-08 4:04
N a v a n e e t h15-Dec-08 4:04 
AnswerRe: knowing the frame work is installed or not Pin
Tom Deketelaere15-Dec-08 4:06
professionalTom Deketelaere15-Dec-08 4:06 
AnswerRe: knowing the frame work is installed or not Pin
Jimmanuel15-Dec-08 4:23
Jimmanuel15-Dec-08 4:23 

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.