0

I'm trying to make a simple Rock Paper Scissor game as my first C# project on Visual Studio but I'm having a bit of trouble.

I'm trying to make the game have a title page like one of those retro games.

I was thinking about making a a page with four options, Start, Exit, Rules, and About. When the user picks an option, a different form appears in the same window that shows the game or shows the rules, etc.

Can anyone point me in the right direction?

user2911044
  • 117
  • 1
  • 2
  • 4
  • 3
    I believe you want [UserControls](http://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol.aspx) – Jonesopolis Oct 23 '13 at 12:32
  • I sort of don't find the Microsoft help page that helpful. I'll try and research more about UserControls. Best idea I got was to hide all the images and show new ones on click. – user2911044 Oct 23 '13 at 12:38
  • pretty much. I'd say in your designer, have all 4 User Controls the same size and stacked on top of eachother, then on whatever button click, bring a User Control to the front. – Jonesopolis Oct 23 '13 at 12:40

5 Answers5

5

Implement your screens as UserControls so that you can manage UserControls from your main form. UserControls are reuseable and you can use a UserControl in different presentation scenarios easily.

mehmet mecek
  • 2,615
  • 2
  • 21
  • 25
1

You can do this by using Panel control. Each time you can set one of them for the visible page. Add enough panels and create your visual look in them, next try to switch between them by setting their visible property.

MahanGM
  • 2,352
  • 5
  • 32
  • 45
  • You got me in the right track I love you man, seriously. Everyone's answer was really great too but I found the Panel control the most relevant to my needs. – user2911044 Oct 23 '13 at 13:50
0

Check out: change active form to show another form

Use their logic to replace your current form based on the action that the user clicked in your options.

Community
  • 1
  • 1
Gobo
  • 687
  • 1
  • 6
  • 16
0

Have a look at the MdiParent setting in your main form. This will identify the main form. For all the child forms they will then need to be assigned to the parent form.

For further reading: http://msdn.microsoft.com/en-us/library/system.windows.forms.containercontrol.parentform.aspx

Ewald
  • 698
  • 7
  • 10
0

If you want your other forms literally inside main form, set IsMdiContainer on your main form and set MDIParent on child forms to your MDI Container (main form) before showing them.

Taken from Change active form to show another form. Credits to MagnatLU

Community
  • 1
  • 1
Fabio Martins
  • 55
  • 2
  • 9