Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated button presses? 1

Status
Not open for further replies.

airprox

Programmer
Dec 2, 2006
12
GB
Hi folks,

I have an application that reads a couple of XML files (different formats) then writes a new text/xml file.

Basically the process is...
1st button pressed, openfile dialog is opened and a unique xml file is read using xmlTextReader. This populates a number of textBoxes on my form.
2nd button pressed, openfile dialog opened and another xml file is read using xmlTextReader. This populates some more textBoxes on the form.
Finally a 3rd button is pressed, this then writes a xml file using StreamWriter, using strings created from the textboxes.

Sooo... my question. Can I add another button to the form, that will look in a certain folder, and cycle through the sequence of button presses for each xml file it finds in there? I reaise this will mean getting rid of the openfile dialogs at each instance, but I think I could use 2 extra textBoxes with the folder path, and location of the file found in the second button press above.

Alternatively, should I just look at creating a exe file that will do the same sort of thing, but with some sort of drag and drop functionality?

Any thoughts or ideas greatly recieved.
Cheers
Alun
 
Do you mean, can you click all 3 buttons from a 4th button? If so you could use
Code:
MyButton1.PerformClick(); 
MyButton2.PerformClick(); 
MyButton3.PerformClick();

Hope this helps.

Age is a consequence of experience
 
Actually that helps a lot... it's made me realise that I'm making it too complicated. What I've done is combined the code for the 3 seperate button presses, for the one button. This way, I can work on removing the openDialog sections without removing that functionality from the individual buttons.

Need to go off and have a play/think... expect more questions!

Cheers
Alun
 
Thanks... Glad i could help.

Age is a consequence of experience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top