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

📄 frmreportsamename.frm

📁 金算盘软件代码
💻 FRM
字号:
VERSION 5.00
Object = "{F42BDC2B-FC9B-11D1-9ABD-444553540000}#3.3#0"; "ATLEDIT.OCX"
Begin VB.Form frmReportSameName 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "输入框"
   ClientHeight    =   1500
   ClientLeft      =   3015
   ClientTop       =   3120
   ClientWidth     =   4815
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1500
   ScaleWidth      =   4815
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin AtlEdit.TEdit txtNewName 
      Height          =   300
      Left            =   120
      TabIndex        =   3
      Top             =   480
      Width           =   4500
      _ExtentX        =   7938
      _ExtentY        =   529
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Text            =   ""
   End
   Begin VB.CommandButton CmdNo 
      Cancel          =   -1  'True
      Height          =   350
      Left            =   3405
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1020
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton CmdOK 
      Default         =   -1  'True
      Height          =   350
      Left            =   2010
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   1020
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.Label lblMessage 
      AutoSize        =   -1  'True
      Caption         =   "新标题名"
      Height          =   180
      Left            =   144
      TabIndex        =   0
      Top             =   192
      Width           =   720
   End
End
Attribute VB_Name = "frmReportSameName"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                                       输入框窗体
'
'作者:雷宇                 时间:1998/08/05
'
'功能:返回一由用户输入的字符串。
'接口函数:
'   ShowInputBox(ByVal strLabelMsg As String, strText As String, Optional FormCaption As String = "") As Boolean
'接口参数:
'   strLabelMsg:必需的,提示信息;
'   strText:    必需的,是按地址传的参数,返回一新值;
'   FormCaption:可选的,设置窗体的“Caption”。若为空,则以系统的标题设置窗体的“Caption”。
'
'返回值:Boolean值---True: strText重新设置;False:取消设置。
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
Private mblnOk As Boolean
Private mstrLabelCap As String
Private mstrName As String
Private mstrMyCaption As String
Private mblnCheckErr As Boolean

Private Sub CmdNo_Click()
    mblnOk = False
    Unload Me
End Sub

Private Sub cmdOK_Click()
    If Trim(txtNewName.Text) = "" Then
       Utility.ShowMsg Me.hwnd, "输入内容不能为空!", vbOKOnly, App.title
       txtNewName.SetFocus
       Exit Sub
    End If
    mstrName = Trim(txtNewName.Text)
    mblnOk = True
    Unload Me
End Sub

Private Sub Form_Activate()
    txtNewName.SetFocus
End Sub

Private Sub Form_Load()
    Me.HelpContextID = 31001
    mblnOk = False
    loadResPic
    Set Me.Icon = Utility.GetFormResPicture(139, vbResIcon)
End Sub

Public Function ShowInputBox(ByVal strLabelMsg As String, strText As String, _
                             Optional FormCaption As String = "", Optional CheckErr As Boolean = False, _
                             Optional LenOfName As Integer = 40) As Boolean
    
    If LenOfName > 0 Then
       txtNewName.MaxLength = LenOfName
    End If
    If Len(strLabelMsg) = 0 Then
        mstrLabelCap = lblMessage.Caption
    ElseIf Len(strLabelMsg) > 25 Then
        mstrLabelCap = Left(strLabelMsg, 25) & Chr(13) & Right(strLabelMsg, Len(strLabelMsg) - 25)
    Else
        mstrLabelCap = strLabelMsg
    End If
    mstrName = strText
    If FormCaption = "" Then
        mstrMyCaption = GetNoXString(frmMain.Caption, 1, ":")
    Else
        mstrMyCaption = FormCaption
    End If
    mblnCheckErr = CheckErr
    Me.Caption = mstrMyCaption
    lblMessage.Caption = mstrLabelCap
    txtNewName.Text = mstrName
    txtNewName.SelStart = 0
    txtNewName.SelLength = Len(txtNewName.Text)
    Me.Show vbModal
    strText = mstrName
    ShowInputBox = mblnOk
End Function

Private Sub Form_Unload(Cancel As Integer)
    UnloadResPic
    Set Me.Icon = Nothing
    Unload Me
End Sub

Private Sub txtNewName_Change()
    If Trim(txtNewName.Text) = "" Then
        cmdOk.Enabled = False
    Else
        cmdOk.Enabled = True
    End If
End Sub
Private Sub loadResPic()
    cmdOk.Picture = Utility.GetFormResPicture(1001, vbResBitmap)
    CmdNo.Picture = Utility.GetFormResPicture(1002, vbResBitmap)
End Sub
Private Sub UnloadResPic()
    cmdOk.Picture = Nothing
    CmdNo.Picture = Nothing
    Utility.RemoveFormResPicture 1001
    Utility.RemoveFormResPicture 1002
    Utility.RemoveFormResPicture 139
End Sub

Private Sub txtNewName_LostFocus()
  Dim strErr As String
    If Not Me.ActiveControl Is CmdNo Then
        If mblnCheckErr And Report.NameIsErr(txtNewName.Text, strErr) Then
           Utility.ShowMsg Me.hwnd, "帐表名称中包含非法字符“" & strErr & "”!", vbOKOnly, App.title
           txtNewName.SetFocus
           Exit Sub
        End If
    End If
End Sub

⌨️ 快捷键说明

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