Hi All,

Hope everyone is well, it has been a while since I last posted.

I am creating a Yahtzee game, the first thing I want my game to do when it loads is ask for the player/players name/names, so that there scores can be saved to a high scores table.

I have decided to add a text file to my project as a start and I was thinking of using an array to add the score for the winner at the end of each game.

I am stuggling on how to really start this though. I have come up with an idea, I could do with some advise as to weather my idea is any good.

First thing, I need to add a text file and call it something like HighScores

Then I need to add a Windows Form to my project and add some controls for the user/users to fill in there name/names

Question: How can I get my Windows Form for the players names to load when the application is started, do I use a form load event???

Thanks very much

John

Recommended Answers

All 2 Replies

Yes, you can use the startup forms Form_Load event.
If you call upon a second form to display as a dialog, then the execution of the Form_Load will "halt" until you close that second form.

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
   Dim players As New Form2
   players.ShowDialog() '<- Execution will halt here until you close Form2
   players.Dispose()
End Sub

Question: How can I get my Windows Form for the players names to load when the application is started, do I use a form load event???

You can always add a new Form, go to Project/"your application" Properties..., Application Tab, and locate the "Startup form:" option.

Or just use the Form_Load event for the Startup Form.:)

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Form2.ShowDialog()
    End Sub
End Class
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.