home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / cdspy / f_seek.frm < prev    next >
Text File  |  1995-02-27  |  4KB  |  135 lines

  1. VERSION 2.00
  2. Begin Form F_Seek 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Suchen"
  5.    ClientHeight    =   1560
  6.    ClientLeft      =   1785
  7.    ClientTop       =   4170
  8.    ClientWidth     =   3180
  9.    Height          =   1965
  10.    Left            =   1725
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1560
  13.    ScaleWidth      =   3180
  14.    Top             =   3825
  15.    Width           =   3300
  16.    Begin CommandButton Cmd_Abbruch 
  17.       BackColor       =   &H00C0C0C0&
  18.       Caption         =   "&Abbruch"
  19.       FontBold        =   0   'False
  20.       FontItalic      =   0   'False
  21.       FontName        =   "MS Sans Serif"
  22.       FontSize        =   9.75
  23.       FontStrikethru  =   0   'False
  24.       FontUnderline   =   0   'False
  25.       Height          =   375
  26.       Left            =   1680
  27.       TabIndex        =   3
  28.       Top             =   1020
  29.       Width           =   1365
  30.    End
  31.    Begin TextBox Txt_Stichwort 
  32.       FontBold        =   0   'False
  33.       FontItalic      =   0   'False
  34.       FontName        =   "Arial"
  35.       FontSize        =   9.75
  36.       FontStrikethru  =   0   'False
  37.       FontUnderline   =   0   'False
  38.       Height          =   360
  39.       Left            =   180
  40.       TabIndex        =   1
  41.       Top             =   450
  42.       Width           =   2865
  43.    End
  44.    Begin CommandButton Cmd_Suche 
  45.       BackColor       =   &H00C0C0C0&
  46.       Caption         =   "&Suchen"
  47.       FontBold        =   0   'False
  48.       FontItalic      =   0   'False
  49.       FontName        =   "MS Sans Serif"
  50.       FontSize        =   9.75
  51.       FontStrikethru  =   0   'False
  52.       FontUnderline   =   0   'False
  53.       Height          =   375
  54.       Left            =   180
  55.       TabIndex        =   2
  56.       Top             =   1020
  57.       Width           =   1365
  58.    End
  59.    Begin Line Line1 
  60.       X1              =   180
  61.       X2              =   3060
  62.       Y1              =   900
  63.       Y2              =   900
  64.    End
  65.    Begin Label Label1 
  66.       AutoSize        =   -1  'True
  67.       Caption         =   "Suchen nach:"
  68.       FontBold        =   0   'False
  69.       FontItalic      =   0   'False
  70.       FontName        =   "Arial"
  71.       FontSize        =   9.75
  72.       FontStrikethru  =   0   'False
  73.       FontUnderline   =   0   'False
  74.       Height          =   240
  75.       Left            =   180
  76.       TabIndex        =   0
  77.       Top             =   180
  78.       Width           =   1200
  79.    End
  80. End
  81. Option Explicit
  82. Option Compare Text
  83.  
  84. Sub Cmd_Abbruch_Click ()
  85.   Unload Me
  86. End Sub
  87.  
  88. Sub Cmd_Suche_Click ()
  89.   Dim Pos%
  90.   screen.MousePointer = 11 ' Sanduhr
  91.   Pos% = InStr(Editfile.Text1, Txt_Stichwort.Text)
  92.   If Pos% = 0 Then
  93.     screen.MousePointer = 0' Default
  94.     MsgBox "Der gesuchte Ausdruck ist nicht vorhanden.", 48, "Suchen"
  95.     Txt_Stichwort.SetFocus
  96.     Exit Sub
  97.   End If
  98.   Editfile.Text1.SelStart = Pos% - 1
  99.   Editfile.Text1.SelLength = Len(Txt_Stichwort.Text)
  100.   GM_SeekString$ = Txt_Stichwort.Text
  101.   Unload Me
  102.   screen.MousePointer = 0 ' Default
  103. End Sub
  104.  
  105. Sub Form_Load ()
  106.   Dim tmp$, Pos%
  107.   Me.Move (screen.Width - Me.Width) / 2, (screen.Height - Me.Height) / 3
  108.   
  109.   tmp$ = Editfile.Text1.SelText
  110.   If tmp$ <> "" Then ' Suchbegriff evtl. markiert
  111.     Pos% = InStr(tmp$, Chr$(13))
  112.     If Pos% <> 0 Then
  113.       tmp$ = Left$(tmp$, Pos% - 1)
  114.     End If
  115.     Me.Txt_Stichwort = Trim$(tmp$)
  116.   End If
  117. End Sub
  118.  
  119. Sub Form_Resize ()
  120. Show3d Me
  121. End Sub
  122.  
  123. Sub Txt_Stichwort_GotFocus ()
  124.   Txt_Stichwort.SelStart = 0
  125.   Txt_Stichwort.SelLength = Len(Txt_Stichwort.Text)
  126. End Sub
  127.  
  128. Sub Txt_Stichwort_KeyPress (KeyAscii As Integer)
  129.   If KeyAscii = 13 Then
  130.     KeyAscii = 0
  131.     Cmd_Suche = True
  132.   End If
  133. End Sub
  134.  
  135.