Click here to Skip to main content
16,020,459 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: Installation problem in embedded XP Pin
Dave Kreskowiak25-May-09 6:40
mveDave Kreskowiak25-May-09 6:40 
GeneralRe: Installation problem in embedded XP Pin
Saleem Anwar25-May-09 22:40
Saleem Anwar25-May-09 22:40 
GeneralRe: Installation problem in embedded XP Pin
Dave Kreskowiak26-May-09 3:32
mveDave Kreskowiak26-May-09 3:32 
QuestionHow To Detect The person who click the print option in any document????? Pin
manjari kar23-May-09 1:43
manjari kar23-May-09 1:43 
AnswerRe: How To Detect The person who click the print option in any document????? Pin
Mycroft Holmes23-May-09 2:06
professionalMycroft Holmes23-May-09 2:06 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar24-May-09 18:18
manjari kar24-May-09 18:18 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Mycroft Holmes24-May-09 19:11
professionalMycroft Holmes24-May-09 19:11 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar24-May-09 23:46
manjari kar24-May-09 23:46 
yes,
u got my point.now plz helpme and give me the right path.
my code is like this.and in this code after print dialog when a person clicks ok then my dialog is comming and asking for username and password.means m able to block the job after going to the print spool.help me that how i will detect before going to the print spool.
private void timer1_Tick(object sender, EventArgs e)
{

PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e");
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
foreach (PrintQueue pq in myPrintQueues)
{
pq.Refresh();
PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection();
foreach (PrintSystemJobInfo job in jobs)
{
if (job.Submitter == "gyana.manjarikar")
{
job.Pause();
}

if (true)
{
//MessageBox.Show(job.Name.ToString());

this.Show();
}

else
this.Hide();
}
}
}

private void btnlogin_Click(object sender, EventArgs e)
{

int copies=10;
this.Opacity = 50;
PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e");
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
foreach (PrintQueue pq in myPrintQueues)
{
pq.Refresh();
PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection();
foreach (PrintSystemJobInfo job in jobs)
{


//if (txtUserName.Text == "aaa" && txtPassword.Text == "bbb" && copies <= 10)
//{
// job.Restart();

//}
if (job.Submitter == "gyana.manjarikar")
{
if (txtUserName.Text == "aa" && txtPassword.Text == "bb" && copies <= 10)
{
timer1.Dispose();
job.Resume();
this.Hide();
}
else
{
lblErrormsg.Text = "Invalid UserName Or Password";
}

}
else
{
this.Show();
timer1.Start();
lblErrormsg.Visible = true;
lblErrormsg.Text = "Invalid User";
}
//if (job.Submitter == "")
//{
// job.Pause();
//}
//else
//{
// lblErrormsg.Visible = true;
// lblErrormsg.Text = "Invalid User";
//}
//if ( txtUserName.Text == "aa" && txtPassword.Text == "bb" )
//{
// job.Pause();
//}

//else
//{
// lblErrormsg.Visible = true;
// lblErrormsg.Text = "Invalid User";
//}
}
}
}




private void btncancel_Click(object sender, EventArgs e)
{
this.Opacity = 50;
this.Hide();
PrintServer myPrintServer = new PrintServer(@"HP LaserJet P2010 Series PCL 5e");
PrintQueueCollection myPrintQueues = myPrintServer.GetPrintQueues();
foreach (PrintQueue pq in myPrintQueues)
{
pq.Refresh();

PrintJobInfoCollection jobs = pq.GetPrintJobInfoCollection();
foreach (PrintSystemJobInfo job in jobs)
{

if (job.Submitter == "gyana.manjarikar")
{
job.Cancel();

}

}// end for each print job
}
}


private void Form1_Load(object sender, EventArgs e)
{

this.Opacity =100;

}
}

}
plz help me that where i will change the code and what i will change .

How i will design a a form in windows service to print a document.

GeneralRe: How To Detect The person who click the print option in any document????? Pin
Mycroft Holmes25-May-09 0:36
professionalMycroft Holmes25-May-09 0:36 
Generalant invasion Pin
Luc Pattyn25-May-09 7:21
sitebuilderLuc Pattyn25-May-09 7:21 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak25-May-09 6:38
mveDave Kreskowiak25-May-09 6:38 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar25-May-09 18:52
manjari kar25-May-09 18:52 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak26-May-09 15:41
mveDave Kreskowiak26-May-09 15:41 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar27-May-09 20:13
manjari kar27-May-09 20:13 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak28-May-09 2:08
mveDave Kreskowiak28-May-09 2:08 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar30-May-09 1:15
manjari kar30-May-09 1:15 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak30-May-09 13:12
mveDave Kreskowiak30-May-09 13:12 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar31-May-09 20:10
manjari kar31-May-09 20:10 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
Dave Kreskowiak1-Jun-09 1:46
mveDave Kreskowiak1-Jun-09 1:46 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar4-Jun-09 20:47
manjari kar4-Jun-09 20:47 
GeneralRe: How To Detect The person who click the print option in any document????? Pin
manjari kar4-Jun-09 21:09
manjari kar4-Jun-09 21:09 
QuestionOffice Ribbon functionality Pin
windhopper22-May-09 2:23
windhopper22-May-09 2:23 
QuestionAliens stole my toolStrip, please help :'( Pin
Baeltazor21-May-09 14:52
Baeltazor21-May-09 14:52 
AnswerRe: Aliens stole my toolStrip, please help :'( [modified] Pin
Alan N21-May-09 22:38
Alan N21-May-09 22:38 
GeneralRe: Aliens stole my toolStrip, please help :'( Pin
Baeltazor22-May-09 15:50
Baeltazor22-May-09 15:50 

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.