Frage zu Inputfeld

  • ?( Ich habe in einem Inputfeld einen Nutzerhinweis schwarz auf weiss hinterlegt.

    z.B.: Hier Ihre Größe in cm eingeben !

    $Input1 = GUICtrlCreateInput("Hier Ihre Größe in cm eingeben !", 40, 96, 290, 30)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")

    Nun würde ich diesen Hinweis gerne blau markieren , so daß sich Dieser bei der Eingabe durch den Nutzer automatisch löscht.

    Die Aussagen der Hilfen (de,en) zu Inputbox bzw. Msgbox waren für mich nicht aufschlussreich !

    Im Voraus Herzlichen Dank für Eure Antworten

  • Hallo Xenobiologist und Danke!

    Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>

    $Form1_1 = GUICreate("iesis IGR v 3.0", 370, 300, 193, 115)
    GUISetFont(12, 400, 0, "MS Sans Serif")
    $Label1 = GUICtrlCreateLabel(" Ihr IdealGewichtsRechner ", 32, 32, 318, 30)
    GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
    $Input1 = GUICtrlCreateInput("Hier Ihre Größe in cm eingeben !", 40, 96, 290, 30)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Button1 = GUICtrlCreateButton("Idealgewicht berechnen", 40, 152, 290, 30, 0)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label2 = GUICtrlCreateLabel("", 88, 216, 185, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label3 = GUICtrlCreateLabel("-kein-", 40, 255, 290, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label4 = GUICtrlCreateLabel("V 3.0 Build 20070923", 0, 280, 107, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Icon1 = GUICtrlCreateIcon("Smiley12.ico", 0, 296, 240, 32, 32, BitOR($SS_NOTIFY,

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

    $WS_GROUP))
    $Label5 = GUICtrlCreateLabel("Kiesi", 344, 280, 27, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUISetState(@SW_SHOW)

    While 1
    $nMsg = GUIGetMsg()
    If $nMsg <> 0 Then
    $Zahl1 = GUICtrlRead($Input1)
    Select
    Case $nMsg = $Button1
    If not StringIsDigit(GUICtrlRead($Input1)) Then
    GUICtrlSetData($Label3, "Bitte nur Zahlen eingeben

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

    !")
    Else
    $Zahl2 = ($Zahl1 - 100) * 0.9
    GUICtrlSetData($Label3, "Ihr Idealgewicht : "&

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

    $Zahl2 & " kg ")
    EndIf
    Case $nMsg = $GUI_EVENT_CLOSE
    Exit
    ExitLoop
    EndSelect
    EndIf

    WEnd

    [/autoit]

    =)

    • Offizieller Beitrag

    HI,

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

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

    $Form1_1 = GUICreate("iesis IGR v 3.0", 370, 300, 193, 115)
    GUISetFont(12, 400, 0, "MS Sans Serif")
    $Label1 = GUICtrlCreateLabel(" Ihr IdealGewichtsRechner ", 32, 32, 318, 30)
    GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif")
    $Input1 = GUICtrlCreateInput("Hier Ihre Größe in cm eingeben !", 40, 96, 290, 30)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    GUICtrlSetState(-1, $GUI_FOCUS)
    $Button1 = GUICtrlCreateButton("Idealgewicht berechnen", 40, 152, 290, 30, 0)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label2 = GUICtrlCreateLabel("", 88, 216, 185, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label3 = GUICtrlCreateLabel("-kein-", 40, 255, 290, 24)
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    $Label4 = GUICtrlCreateLabel("V 3.0 Build 20070923", 0, 280, 107, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    $Icon1 = GUICtrlCreateIcon("Smiley12.ico", 0, 296, 240, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
    $Label5 = GUICtrlCreateLabel("Kiesi", 344, 280, 27, 18)
    GUICtrlSetFont(-1, 8, 400, 0, "Arial")
    GUISetState(@SW_SHOW)

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

    While 1
    $nMsg = GUIGetMsg()
    If $nMsg <> 0 Then
    $Zahl1 = GUICtrlRead($Input1)
    Select
    Case $nMsg = $Button1
    If Not StringIsDigit(GUICtrlRead($Input1)) Then
    GUICtrlSetData($Label3, "Bitte nur Zahlen eingeben !")
    Else
    $Zahl2 = ($Zahl1 - 100) * 0.9
    GUICtrlSetData($Label3, "Ihr Idealgewicht : " & $Zahl2 & " kg ")
    EndIf
    Case $nMsg = $GUI_EVENT_CLOSE
    Exit
    ExitLoop
    EndSelect
    EndIf

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

    WEnd

    [/autoit]

    So long,

    Mega