home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmWordBreak
- BackColor = &H00C0C0C0&
- Caption = "WordBreak"
- ClientHeight = 4140
- ClientLeft = 1092
- ClientTop = 1488
- ClientWidth = 4068
- Height = 4560
- Left = 1044
- LinkTopic = "Form2"
- ScaleHeight = 4140
- ScaleWidth = 4068
- Top = 1116
- Width = 4164
- Begin SSCheck cWordBreak
- Caption = "WordBreak "
- Height = 270
- Left = 135
- TabIndex = 1
- Top = 2655
- Width = 1365
- End
- Begin CBVBX ctlWordBreak
- CBType = 17 ' 17 - WordBreakProc
- Left = 0
- Top = 0
- End
- Begin TextBox eWordBreak
- Height = 1515
- Left = 90
- MultiLine = -1 'True
- TabIndex = 0
- Text = "Dies ist ein WordBreak-Test. Bei eigener Wortumbruch-Prozedur werden die Zeilen auch an einem Bindestrich umgebrochen."
- Top = 975
- Width = 2025
- End
- Begin Label Label2
- BackStyle = 0 'Transparent
- Caption = "Geben Sie im Eingabefeld einen Text ein und sehen Sie was bei eingeschaltetem und abgeschaltetem Wordbreak passiert."
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.6
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 855
- Left = 90
- TabIndex = 4
- Top = 60
- Width = 3855
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Jetzt wird der Wortumbruch an Leerzeichen und an Bindestrichen durchgef
- hrt."
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.6
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 1305
- Index = 1
- Left = 1695
- TabIndex = 3
- Top = 2655
- Visible = 0 'False
- Width = 2265
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Jetzt wird der Wortumbruch nur an Leerzeichen durchgef
- hrt."
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.6
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 1350
- Index = 0
- Left = 1695
- TabIndex = 2
- Top = 2655
- Width = 2250
- End
- Option Explicit
- Sub ctlWordBreak_WordBreakProc (szEditText As Long, chCurrentWord As Integer, cbEditText As Integer, Action As Integer, retval As Integer)
- Dim s$, c$, i%, l%
- s$ = StringAtAdress(szEditText)
- i = chCurrentWord
- Select Case Action
- Case WB_ISDELIMITER:
- c$ = Mid$(s, i + 1, 1)
- If c = " " Or c = "-" Then
- retval = True
- Exit Sub
- End If
- Case WB_RIGHT:
- l% = Len(s$)
- While Mid$(s$, i + 1, 1) <> " " And Mid$(s$, i + 1, 1) <> "-" And i% <= l%
- i = i + 1
- Wend
- retval = i
- Case WB_LEFT:
- While Mid$(s$, i + 1, 1) <> " " And Mid$(s$, i + 1, 1) <> "-" And i% + 1 > 1
- i = i - 1
- Wend
- retval = i
- End Select
- End Sub
- Sub cWordBreak_Click (Value%)
- Dim dummy
- Dim a$
- If cWordBreak.Value Then
- Label1(1).Visible = True
- Label1(0).Visible = False
- ctlWordBreak.WordBreakWnd = eWordBreak.hWnd
- Else
- Label1(0).Visible = True
- Label1(1).Visible = False
- ctlWordBreak.WordBreakWnd = 0
- End If
- '
- nderung im Edit Control provozieren.
- 'Dabei durch manuelles Setzen des Redraw-Flags ein
- 'Flackern vermeiden.
- a$ = eWordBreak.Text
- 'dummy = SendMessage(eWordBreak.hWnd, WM_SETREDRAW, ByVal False, ByVal 0&)
- eWordBreak.Text = ""
- eWordBreak.Text = a$
- 'dummy = SendMessage(eWordBreak.hWnd, WM_SETREDRAW, ByVal True, ByVal 0&)
- End Sub
-