GUI - Button Style und Bilder

  • VBScript

    GUI - Button Style und Bilder

    Hey Leute,
    Als erstes würde ich erstmal gerne allen hier hallo sagen. Ich hoffe einfach mal darauf dass ich hier richtig bin und ihr meine kleine Rechtschreibschwäche akzeptiert (xD)

    Also nun zu meinem Problem:
    Ich bin schon seit einiger Zeit mit BAT am fahren. jedoch gibts dort keine GUI...
    Jetzt wollte ich mich mal dran wagen für ein etwas größeres Projekt zu arbeiten. Jedoch ist für sowas ne reine textausgabe nartürlich mist...

    Nach langem suchen habe ich nur einen lösungsansatz gefunden....

    Visual Basic-Quellcode

    1. Option Explicit
    2. Dim aOpt(4)
    3. aOpt(0) = "1"
    4. aOpt(1) = "2"
    5. aOpt(2) = "3"
    6. aOpt(3) = "4"
    7. aOpt(4) = "5"
    8. Dim objFSO, objFile, MeineVariable
    9. Const ForWriting = 2
    10. Const Create = trueSet objFSO = Wscript.CreateObject("Scripting.FileSystemObject")
    11. Set objFile = objFSO.OpenTextFile("tmp.txt", ForWriting, Create)
    12. MeineVariable = SelectBox("test", aOpt)
    13. objFile.WriteLine MeineVariable
    14. objFile.closeSet objFile = nothing
    15. Set objFSO = nothing
    16. Function SelectBox(sTitle, aOptions)
    17. Dim oIE, s, item
    18. set oIE = CreateObject("InternetExplorer.Application")
    19. With oIE
    20. .ToolBar = False : .RegisterAsDropTarget = False
    21. .StatusBar = False : .Navigate("about:blank")
    22. While .Busy : WScript.Sleep 100 : Wend
    23. With .document
    24. With .parentWindow
    25. if Instr(.navigator.appVersion, "MSIE 6") > 0 Then
    26. oIE.FullScreen = True
    27. End if
    28. oIE.width = 400 : oIE.height = 150
    29. oIE.left = .screen.width \ 2 - 200
    30. oIE.top = .screen.height\ 2 - 75
    31. End With ' ParentWindow
    32. s = "<html><head><title>" & sTitle & " " & String(80, ".") _
    33. & "</title></head><script language=vbs>bWait=true</script>" _
    34. & "<body bgColor=Silver><center><b>" & sTitle & "<b><p>" _
    35. & "<select id=entries size=1 style='width:250px'>" _
    36. & " <option selected>" & sTitle & "</option>"
    37. For each item in aOptions
    38. s = s & " <option>" & item & "</option>"
    39. Next
    40. s = s & " </select><p>" _
    41. & "<button id=but0 onclick='bWait=false'>OK</button>" _
    42. & "</center></body></html>"
    43. .WriteLn(s)
    44. With .body
    45. .scroll="no"
    46. .style.borderStyle = "outset"
    47. .style.borderWidth = "3px"
    48. End With ' Body
    49. .all.entries.focus
    50. oIE.Visible = True
    51. On Error Resume Next
    52. While .ParentWindow.bWait
    53. WScript.Sleep 100
    54. if oIE.Visible Then SelectBox = "Aborted"
    55. if Err Then Exit Function
    56. Wend ' Wait
    57. On Error Goto 0
    58. With .ParentWindow.entries
    59. SelectBox = .options(.selectedIndex).text
    60. End With
    61. End With ' document
    62. .Visible = False
    63. End With ' IE
    64. End Function



    Wie die Experten hier sehen können (also alle auser ich xD) wird hier halt ne Dropdpwn GUI erstellt. Das ganze läuft auch ohne HTA ab (Zum Glück...)
    Das endergebnis wird halt in ner txt-datei gespeichert (Zwichenverarbeitung durch BAT)

    Su nun denn...
    jedoch hätte ich halt lieber ein GUI mit Buttons...

    Ich will jetzt aber nartürlich nicht nen Quellcode in dem alles fertig ist... villeicht ein paar Hilfestellungen (TUTs oder sowas [hab da nach ewiger Forensuche und googeln nix gefunden...]) und/oder Codeschnipsel die mir Helfen könnten...

    da ich blutiger anfänger in VBS bin seit bitte ned Böse wenn ich nicht alles Verstehe ^^

    MFG
    note