VERSION 5.00 Begin VB.Form frmInputDlg Caption = "Input Dialog" ClientHeight = 1590 ClientLeft = 60 ClientTop = 345 ClientWidth = 5940 Icon = "frmInputDlg.frx":0000 LinkTopic = "Form2" ScaleHeight = 1590 ScaleWidth = 5940 StartUpPosition = 1 'CenterOwner Visible = 0 'False Begin VB.TextBox txtContent Height = 285 Left = 120 TabIndex = 0 Top = 1080 Width = 5655 End Begin VB.CommandButton cmdCancel Caption = "&Cancel" Height = 330 Left = 4560 TabIndex = 2 Top = 600 Width = 1215 End Begin VB.CommandButton cmdOK Caption = "&Ok" Height = 330 Left = 4560 TabIndex = 1 Top = 120 Width = 1215 End Begin VB.Label lblTip AutoSize = -1 'True Height = 195 Left = 240 TabIndex = 3 Top = 120 Width = 45 End End Attribute VB_Name = "frmInputDlg" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim strContent As String Public Function test() As String Me.Show 1 test = s End Function Private Sub cmdCancel_Click() strContent = "NULL" Unload Me End Sub Private Sub cmdOK_Click() strContent = txtContent.Text Unload Me End Sub Private Sub Form_Unload(Cancel As Integer) i = 1 End Sub 'MsgBox frmInputDlg.InputBoxEx("test","please input ","100") Public Function InputBoxEx(strTitle As String,strMsg As String,strContentPre As String) As String Me.Caption = strTitle lblTip.Caption = strMsg txtContent.Text = strContentPre txtContent.SelStart = 0 txtContent.SelLength = Len(txtContent.Text) Me.Show 1 InputBoxEx = strContent End Function