Click here to Skip to main content
14,979,301 members
Home / Discussions / C#
   

C#

 
Question[Message Deleted] Pin
Prajeesh26-Feb-09 20:05
MemberPrajeesh26-Feb-09 20:05 
AnswerRe: Open PDF in RichTextBox Pin
Christian Graus26-Feb-09 20:17
protectorChristian Graus26-Feb-09 20:17 
Question[Message Deleted] Pin
Prajeesh27-Feb-09 0:27
MemberPrajeesh27-Feb-09 0:27 
AnswerRe: Open PDF in RichTextBox Pin
Calin Tatar27-Feb-09 0:47
MemberCalin Tatar27-Feb-09 0:47 
Questionconverting Pin
kanthgadu26-Feb-09 20:00
Memberkanthgadu26-Feb-09 20:00 
AnswerRe: converting Pin
Christian Graus26-Feb-09 20:16
protectorChristian Graus26-Feb-09 20:16 
AnswerRe: converting Pin
Shyam K Pananghat26-Feb-09 20:30
MemberShyam K Pananghat26-Feb-09 20:30 
QuestionWMI service causes strange behaviour Pin
shabya26-Feb-09 19:59
Membershabya26-Feb-09 19:59 
hello,
i am using WMI to trap PrintJobs.
when a PrintJob arrives - the event HandleEvent is triggered nicely.
in the Event i wish to open a Form with the form.show()
the Form is opened but remains frozen with the Not Responding message.
if i use the form.showdialog() it looks ok but not sure what dimends hides behind...
i tested the trigger mechanism by using a timer which fires the same event.
in this case there is no problem with the form.show()
at first i thought it was a problem with my form itself but it was not so
because i changed the form to a simple form with nothing inside and it responded the same way.
i also tried hiding the form and showing it but the same problem accured.
then i went and created a different WMI , with timer. same problem.

when i look at the processes in the window task manager i see
both my form and another application with the same name.
maybe this can give a hint?

can anyone tell me what am i doing wrong ?
my fingers are acing for a solution...


here's a piece of my code :

this is what i use to trap the event :
--------------------------------------

WqlEventQuery query = new WqlEventQuery(@"Select * From __InstanceCreationEvent Within 3 Where TargetInstance ISA 'Win32_PrintJob'");           

            ManagementEventWatcher watcher = new ManagementEventWatcher(query);            
            
            watcher.EventArrived += new EventArrivedEventHandler(this.HandleEvent);

            PrintJobCollection.ResetMyPrintJobCollection();

            watcher.Start();




this is what needs to be done when the event arrives:
-----------------------------------------------------
public void HandleEvent(object sender, EventArrivedEventArgs e)

{

Form OpenCountMaxForm = new PaperCountMaxForm();
OpenCountMaxForm.Show(); 

}


thanks in advance,

avi Smile | :)
AnswerRe: WMI service causes strange behaviour Pin
Calin Tatar26-Feb-09 22:32
MemberCalin Tatar26-Feb-09 22:32 
GeneralRe: WMI service causes strange behaviour Pin
shabya26-Feb-09 22:43
Membershabya26-Feb-09 22:43 
QuestionDrag Drop listView Imagelist Images..... [modified] Pin
S K Y26-Feb-09 19:45
MemberS K Y26-Feb-09 19:45 
AnswerRe: Drag Drop listView Imagelist Images..... Pin
Calin Tatar26-Feb-09 22:26
MemberCalin Tatar26-Feb-09 22:26 
GeneralRe: Drag Drop listView Imagelist Images..... Pin
S K Y1-Mar-09 2:16
MemberS K Y1-Mar-09 2:16 
AnswerRe: Drag Drop listView Imagelist Images..... Pin
STeAlth-S26-Feb-09 23:17
MemberSTeAlth-S26-Feb-09 23:17 
GeneralRe: Drag Drop listView Imagelist Images..... Pin
S K Y1-Mar-09 2:43
MemberS K Y1-Mar-09 2:43 
GeneralRe: Drag Drop listView Imagelist Images..... Pin
S K Y1-Mar-09 2:50
MemberS K Y1-Mar-09 2:50 
Questionproject Pin
shobansama26-Feb-09 19:41
Membershobansama26-Feb-09 19:41 
AnswerRe: project Pin
Christian Graus26-Feb-09 20:16
protectorChristian Graus26-Feb-09 20:16 
GeneralRe: project Pin
CPallini26-Feb-09 22:16
mveCPallini26-Feb-09 22:16 
AnswerRe: project Pin
abdul jalil1-Mar-09 4:14
Memberabdul jalil1-Mar-09 4:14 
Questionstring to datetime conversion ? Pin
Aghosh Babu26-Feb-09 19:28
MemberAghosh Babu26-Feb-09 19:28 
AnswerRe: string to datetime conversion ? Pin
Shyam K Pananghat26-Feb-09 20:13
MemberShyam K Pananghat26-Feb-09 20:13 
AnswerRe: string to datetime conversion ? Pin
Vikram A Punathambekar26-Feb-09 20:55
MemberVikram A Punathambekar26-Feb-09 20:55 
GeneralRe: string to datetime conversion ? Pin
Aghosh Babu26-Feb-09 21:01
MemberAghosh Babu26-Feb-09 21:01 
GeneralRe: string to datetime conversion ? Pin
J4amieC26-Feb-09 21:51
MemberJ4amieC26-Feb-09 21:51 

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.