⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newgame.frm

📁 汉诺塔的程序源码和动画演示
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "New game"
   ClientHeight    =   1305
   ClientLeft      =   45
   ClientTop       =   315
   ClientWidth     =   1170
   Icon            =   "NewGame.frx":0000
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1305
   ScaleWidth      =   1170
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton Command1 
      Caption         =   "Start"
      Default         =   -1  'True
      Height          =   315
      Left            =   30
      TabIndex        =   7
      Top             =   960
      Width           =   1095
   End
   Begin VB.Frame Frame1 
      Height          =   1005
      Left            =   30
      TabIndex        =   0
      Top             =   -60
      Width           =   1125
      Begin VB.OptionButton Option1 
         Caption         =   "6"
         Height          =   225
         Index           =   5
         Left            =   600
         TabIndex        =   6
         Top             =   720
         Width           =   495
      End
      Begin VB.OptionButton Option1 
         Caption         =   "5"
         Height          =   225
         Index           =   4
         Left            =   600
         TabIndex        =   5
         Top             =   450
         Width           =   495
      End
      Begin VB.OptionButton Option1 
         Caption         =   "4"
         Height          =   225
         Index           =   3
         Left            =   600
         TabIndex        =   4
         Top             =   180
         Width           =   495
      End
      Begin VB.OptionButton Option1 
         Caption         =   "3"
         Height          =   225
         Index           =   2
         Left            =   90
         TabIndex        =   3
         Top             =   720
         Width           =   495
      End
      Begin VB.OptionButton Option1 
         Caption         =   "2"
         Height          =   225
         Index           =   1
         Left            =   90
         TabIndex        =   2
         Top             =   450
         Width           =   495
      End
      Begin VB.OptionButton Option1 
         Caption         =   "1"
         Height          =   225
         Index           =   0
         Left            =   90
         TabIndex        =   1
         Tag             =   "1"
         Top             =   180
         Value           =   -1  'True
         Width           =   495
      End
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetSystemMenu Lib "user32" _
    (ByVal hwnd As Long, _
     ByVal bRevert As Long) As Long

Private Declare Function RemoveMenu Lib "user32" _
    (ByVal hMenu As Long, _
     ByVal nPosition As Long, _
     ByVal wFlags As Long) As Long
     
Const MF_BYPOSITION = &H400&

Public Function DisableCloseButton(frm As Form) As Boolean

'PURPOSE: Removes X button from a form
'EXAMPLE: DisableCloseButton Me
'RETURNS: True if successful, false otherwise
'NOTES:   Also removes Exit Item from
'         Control Box Menu


    Dim lHndSysMenu As Long
    Dim lAns1 As Long, lAns2 As Long
    
    
    lHndSysMenu = GetSystemMenu(frm.hwnd, 0)

    'remove close button
    lAns1 = RemoveMenu(lHndSysMenu, 6, MF_BYPOSITION)

   'Remove seperator bar
    lAns2 = RemoveMenu(lHndSysMenu, 5, MF_BYPOSITION)
    
    'Return True if both calls were successful
    DisableCloseButton = (lAns1 <> 0 And lAns2 <> 0)

End Function


Private Sub Command1_Click()
Form1.Tag = Option1(0).Tag
Unload Me
End Sub

Private Sub Form_Load()
Dim a As Boolean
a = DisableCloseButton(Me)
End Sub

Private Sub Option1_Click(Index As Integer)
Option1(0).Tag = Index + 1
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -