home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BackColor = &H00C0C0C0&
- Caption = "Prompt Control Demo"
- ClientHeight = 6285
- ClientLeft = 900
- ClientTop = 1590
- ClientWidth = 7485
- Height = 6750
- Icon = PROMDEMO.FRX:0000
- Left = 810
- LinkTopic = "Form1"
- ScaleHeight = 6285
- ScaleWidth = 7485
- Top = 1215
- Width = 7665
- Begin CommandButton btnHelp
- Caption = "&Help"
- Height = 435
- Left = 5775
- TabIndex = 10
- Top = 5040
- Width = 1065
- End
- Begin CommandButton btnAbout
- Caption = "&About"
- Height = 435
- Left = 4515
- TabIndex = 9
- Top = 5040
- Width = 1065
- End
- Begin CommandButton btnExit
- Caption = "E&xit"
- Height = 435
- Left = 5775
- TabIndex = 8
- Top = 5565
- Width = 1065
- End
- Begin Prompt Prompt1
- BackColor = &H00FFFFFF&
- BorderStyle = 0 'None
- ForeColor = &H00000000&
- Height = 2535
- Left = 630
- ScrollBars = 2 'Vertical
- TabIndex = 0
- Top = 735
- Width = 6210
- WordDelimiters = ", :"
- End
- Begin Label Text4
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Height = 330
- Left = 630
- TabIndex = 3
- Top = 5355
- Width = 1590
- End
- Begin Label Text2
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- DragMode = 1 'Automatic
- Height = 330
- Left = 630
- TabIndex = 2
- Top = 4515
- Width = 6210
- End
- Begin Label Text1
- BackColor = &H00FFFFFF&
- BorderStyle = 1 'Fixed Single
- Height = 330
- Left = 630
- TabIndex = 1
- Top = 3675
- Width = 6210
- End
- Begin Label Label4
- BackColor = &H00C0C0C0&
- Caption = "Enter any text in the prompt box below. Active keywords are 'calc', 'help', 'clear', and 'exit'."
- Height = 645
- Left = 630
- TabIndex = 7
- Top = 105
- Width = 4215
- End
- Begin Label Label3
- BackColor = &H00C0C0C0&
- Caption = "Prompt1.NumWords"
- Height = 225
- Left = 630
- TabIndex = 6
- Top = 5145
- Width = 1905
- End
- Begin Label Label2
- BackColor = &H00C0C0C0&
- Caption = "Prompt1.Words(i)"
- Height = 225
- Left = 630
- TabIndex = 5
- Top = 4305
- Width = 1590
- End
- Begin Label Label1
- BackColor = &H00C0C0C0&
- Caption = "InputLine"
- Height = 225
- Left = 630
- TabIndex = 4
- Top = 3465
- Width = 1380
- End
- Option Explicit
- Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
- Sub btnAbout_Click ()
- frmAbout.Show
- End Sub
- Sub btnExit_Click ()
- End
- End Sub
- Sub btnHelp_Click ()
- Dim iRV As Integer
- iRV = WinHelp(Me.hWnd, "prompt.hlp", 3, 0)
- End Sub
- Sub Prompt1_Enter (InputLine As String)
- Text1.Caption = InputLine
- Text4.Caption = Str$(Prompt1.NumWords)
- Text2.Caption = ""
- Dim i As Long
- If (Prompt1.NumWords > 0) Then
- Text2.Caption = Prompt1.Words(0)
- End If
- For i = 1 To Prompt1.NumWords - 1
- Text2.Caption = Text2.Caption & " | " & Prompt1.Words(i)
- Next i
- ' The following block of code is typical of code you would
- ' use in an application to interpret commands entered
- ' through the Prompt Control:
- If (Prompt1.NumWords > 0) Then
- Select Case Prompt1.Words(0)
- Case "exit"
- End
- Case "help"
- Dim NL As String
- NL = Chr$(13) + Chr$(10)
- 'This demonstrates how you would display the results of a command
- 'entered in the prompt box by using the .AppendText property.
- Prompt1.AppendText = NL
- Prompt1.AppendText = NL + "COMMANDS:"
- Prompt1.AppendText = NL + " help Shows this help message."
- Prompt1.AppendText = NL + " calc Shell out to run the Windows Calculator."
- Prompt1.AppendText = NL + " clear Clear the prompt box display."
- Prompt1.AppendText = NL + " exit End the Prompt Control Demo."
- Prompt1.AppendText = NL
- Case "clear"
- Prompt1.Text = ""
- Case "calc"
- i = Shell("Calc.EXE", 1)
- End Select
- End If
- End Sub
-