Markierter Text

  • Hallo zusammen,

    eines vorneweg: Ich bin Anfänger!!!!
    Also langsam schreiben, da ich nicht so schnell lesen kann!!!! ;- )

    Zum Thema.
    Ich habe ein Skript, mit dem ich aus einer Datei (Info.txt) die einzelnen Buchstaben auslesen lasse, diese in eine Box einfüge.
    Jetzt ist der Text, wenn die Box testweise gestartet wird komplett markiert.
    Habt Ihr nen Tip, wie ich das umgehe, dass der Text markiert ist ?


    Vielen Dank im voraus.

    Ulrich Mendel ?( ?( ?(

    Einmal editiert, zuletzt von spunnkie (8. Oktober 2008 um 10:07)

  • #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>


    ; Info.TXT auslesen
    $file = FileOpen("info.txt", 0)
    $text = ""
    ; Read in 1 character at a time until the EOF is reached
    While 1
    $chars = FileRead($file, 1)
    If @error = -1 Then ExitLoop
    $text = $text & $chars
    WEnd
    FileClose($file)


    #Region ### START Koda GUI section ### Form=D:\Programmierung\newsletter\newsletter.kxf
    $Form1 = GUICreate("Form1", 633, 591, 321, 265)
    $Newsletter = GUICtrlCreateEdit("", 16, 8, 601, 457)

    GUICtrlSetData(-1, StringFormat($text))
    GUICtrlSetResizing(-1, $GUI_DOCKHCENTER)

    $OK = GUICtrlCreateButton("OK", 264, 512, 113, 49, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    Case $Newsletter
    Case $OK
    Exit
    EndSwitch
    WEnd

    • Offizieller Beitrag

    z.B.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <GuiEdit.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; Info.TXT auslesen
    $file = FileOpen("test.txt", 0)
    $text = ""
    ; Read in 1 character at a time until the EOF is reached
    While 1
    $chars = FileRead($file, 1)
    If @error = -1 Then ExitLoop
    $text = $text & $chars
    WEnd
    FileClose($file)

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=D:\Programmierung\newsletter\newsletter.kxf
    $Form1 = GUICreate("Form1", 633, 591, 321, 265)
    $Newsletter = GUICtrlCreateEdit("", 16, 8, 601, 457)

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetData(-1, StringFormat($text))
    GUICtrlSetResizing(-1, $GUI_DOCKHCENTER)

    [/autoit] [autoit][/autoit] [autoit]

    $OK = GUICtrlCreateButton("OK", 264, 512, 113, 49, 0)
    GUICtrlSetState(-1, $gui_Focus)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    Case $Newsletter
    Case $OK
    Exit
    EndSwitch
    WEnd

    [/autoit]

    Mega