home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / Memory / frmIntro.frm (.txt) next >
Encoding:
Visual Basic Form  |  2001-10-08  |  3.0 KB  |  88 lines

  1. VERSION 5.00
  2. Begin VB.Form frmIntro 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "VB Memory - A DirectPlay Sample"
  5.    ClientHeight    =   1515
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   2745
  9.    Icon            =   "frmIntro.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1515
  14.    ScaleWidth      =   2745
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.CommandButton cmdSingle 
  17.       Caption         =   "Solitaire"
  18.       Height          =   375
  19.       Left            =   315
  20.       TabIndex        =   2
  21.       Top             =   1020
  22.       Width           =   975
  23.    End
  24.    Begin VB.CommandButton cmdMulti 
  25.       Caption         =   "Multiplayer"
  26.       Default         =   -1  'True
  27.       Height          =   375
  28.       Left            =   1455
  29.       TabIndex        =   0
  30.       Top             =   1020
  31.       Width           =   975
  32.    End
  33.    Begin VB.Label lbl 
  34.       BackStyle       =   0  'Transparent
  35.       Caption         =   "This sample will show a developer a simplistic game (Memory).  Please choose how you would like to play this game."
  36.       Height          =   1035
  37.       Left            =   60
  38.       TabIndex        =   1
  39.       Top             =   60
  40.       Width           =   2475
  41.    End
  42. Attribute VB_Name = "frmIntro"
  43. Attribute VB_GlobalNameSpace = False
  44. Attribute VB_Creatable = False
  45. Attribute VB_PredeclaredId = True
  46. Attribute VB_Exposed = False
  47. Option Explicit
  48. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  49. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  50. '  File:       frmIntro.frm
  51. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  52. Private Sub cmdMulti_Click()
  53.     Dim StagingArea As New frmStage
  54.     'Oh good, we want to play a multiplayer game.
  55.     'First lets get the dplay connection started
  56.     'Here we will init our DPlay objects
  57.     InitDPlay
  58.     Set DPlayEventsForm = New DPlayConnect
  59.     Load StagingArea
  60.     EnableButtons False
  61.     'We only want to have a maximum of 4 players
  62.     If Not DPlayEventsForm.StartConnectWizard(dx, dpp, AppGuid, 4, StagingArea) Then
  63.         Cleanup
  64.         EnableButtons True
  65.     Else 'We did choose to play a game
  66.         gsUserName = DPlayEventsForm.UserName
  67.         Me.Hide
  68.         StagingArea.Show vbModeless
  69.         gfHost = DPlayEventsForm.IsHost
  70.     End If
  71. End Sub
  72. Private Sub cmdSingle_Click()
  73.     'We don't want to use DPlay, close down our objects
  74.     Cleanup
  75.     gbNumPlayers = 1
  76.     EnableButtons False
  77.     Me.Hide
  78.     frmGameBoard.Show
  79. End Sub
  80. Private Sub Form_Unload(Cancel As Integer)
  81.     Cleanup
  82.     End
  83. End Sub
  84. Public Sub EnableButtons(ByVal fEnable As Boolean)
  85.     cmdMulti.Enabled = fEnable
  86.     cmdSingle.Enabled = fEnable
  87. End Sub
  88.