lol okay i agree im a complete noob at this.
This is what i need to do when i click the Enter button i want it to open up game.exe, game exe and the game launcher will be in the same folder
Thanks
Printable View
lol okay i agree im a complete noob at this.
This is what i need to do when i click the Enter button i want it to open up game.exe, game exe and the game launcher will be in the same folder
Thanks
Instead of using the thread title to tell us that it's a basic, easy question, please let us judge the level of difficulty and use the thread title to actually describe the problem.
As for the question, we need more info. What does your launcher UI look like? Why are you using a launcher instead of just a regular Windows shortcut?
mmm okay, well my game launchers very simple, it haves 3 buttons and a background, buttons are Enter, Forums, Exit, there is also a webbrowser on it for news.
Im and using a luancher because it produces more infomation about the game.
Can I assume that your Enter button is to run the game and your Exit button is to quit the app? If so then you should assign them to the AcceptButton and CancelButton properties of the form respectively. The AcceptButton is "clicked" when the user hits the Enter key and the CancelButton is "clicked" when the user hits the Escape key.
lol im a complete noob sorry i have no idea, think we could chat on msn or somthing?Quote:
Originally Posted by jmcilhinney
You've set properties on your form before, e.g. Text. This is no different. Open the form in the designer, open the Properties window and set the AcceptButton and CancelButton properties. Done.Quote:
Originally Posted by AllanS
If I understand correctly this question is about how to launch a program not how to set a default button on a form.
All you need to do is add a line at the top of your code to import "System.Diagnostics" and then use the Process.Start method :
vb Code:
Imports System.Diagnostics Public Class frmLauncher Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Process.Start("game.exe") End Sub End Class
You would probably want to throw in some error checking to make sure that game.exe is there etc, but that code will launch the application assuming it is there in the same folder as the launcher as you stated.
Good point. I kinda focused on the:Quote:
Originally Posted by keystone_paul
and not so much on the:Quote:
when i click the Enter button
So, keystone_paul has shown you how to execute a file on a Button Click and I've told you how to invoke that Button Click when the user hits the Enter key. That just about covers the entire question. :)Quote:
i want it to open up game.exe