how to make automatic click ok button on showdialog() on c# application? -
i'm using windows mobile application .. it's microsoft.windowsmobile.samples.cecamera
when capture image dialog form appears tell it's captured , should click ok. in code, uses ok click continue saving picture ... want message stop appearing. or other method make automatic click on ok button.
if (dialogresult.ok == cameracapture.showdialog()) { string filename = cameracapture.filename; // if video rename file has user entered // default filename , correct extension. if (cameracapture.mode != cameracapturemode.still) { string extension = filename.substring(filename.lastindexof(".")); string directory = ""; if (filename.lastindexof("\\") != -1) { directory = filename.substring(0, filename.lastindexof("\\") + 1); } filename = directory + this.textdefaultfilename.text + extension; system.io.file.move(cameracapture.filename, filename); } // method completed successfully. messagebox.show("the picture or video has been captured , saved to:\n\n" + filename, this.text, messageboxbuttons.ok, messageboxicon.asterisk, messageboxdefaultbutton.button1); } }
just remove line (actually, technically it's 2 lines) shows dialog source.
in general, trying automatically click on buttons in own application bad idea.
Comments
Post a Comment