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

📄 fmain.frm

📁 You can call MsgBoxEx instead of MsgBox MsgBoxEx will return the same vbMsgBoxResults as MsgBox, b
💻 FRM
字号:
VERSION 5.00
Begin VB.Form fMain 
   Caption         =   "Main"
   ClientHeight    =   3015
   ClientLeft      =   660
   ClientTop       =   1935
   ClientWidth     =   3960
   Icon            =   "fMain.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   3015
   ScaleWidth      =   3960
   Begin VB.TextBox txtY 
      Height          =   375
      Left            =   2520
      TabIndex        =   5
      Text            =   "100"
      Top             =   2400
      Width           =   615
   End
   Begin VB.TextBox txtX 
      Height          =   375
      Left            =   1080
      TabIndex        =   3
      Text            =   "100"
      Top             =   2400
      Width           =   615
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Custom Icon - Fixed Position"
      Height          =   615
      Left            =   360
      TabIndex        =   2
      Top             =   1680
      Width           =   3255
   End
   Begin VB.CommandButton Command2 
      Caption         =   "No Icon - Form Top Center"
      Height          =   615
      Left            =   360
      TabIndex        =   1
      Top             =   960
      Width           =   3255
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Standard Icon - Centered on Form"
      Height          =   615
      Left            =   360
      TabIndex        =   0
      Top             =   240
      Width           =   3255
   End
   Begin VB.Label Label2 
      Caption         =   "Y:"
      Height          =   255
      Left            =   2160
      TabIndex        =   6
      Top             =   2520
      Width           =   255
   End
   Begin VB.Label Label1 
      Caption         =   "X:"
      Height          =   255
      Left            =   720
      TabIndex        =   4
      Top             =   2520
      Width           =   255
   End
End
Attribute VB_Name = "fMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
Dim ret As VbMsgBoxResult

'MsgBoxEx returns same constants as standard MsgBox call
'and it can be called the same way
ret = MsgBoxEx("This is a test", vbOKCancel Or vbInformation)
If ret = vbOK Then
    MsgBoxEx "User pressed OK!"
ElseIf ret = vbCancel Then
    MsgBoxEx "User Cancelled!"
End If

End Sub

Private Sub Command2_Click()
'Optional Top and Left parameters can be used to position the MsgBox
'Top - sets the Y position in pixels
'Left - sets the X position in pixels
'Default value for each is centered over the calling form/window
'(*note* -1 is reserved as the default value - entering -1 will also cause the window to center)
MsgBoxEx "Another test", Top:=Me.Top / Screen.TwipsPerPixelY

End Sub

Private Sub Command3_Click()
'Optional Icon parameter can be used to show a custom icon
'instead of the Windows default icons
MsgBoxEx "Last test", vbInformation, "Too Cool!", Val(txtX), Val(txtY), Me.Icon

End Sub

⌨️ 快捷键说明

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