Hallo!
Erstmal möchte ich sagen, dass ich es wirklich klasse finde, dass es ein solch tolles Forum für Autoit gibt
Ich schaue hier gerne hinein und die meisten meiner Fragen werden dann schon gelöst.
Doch drei Fragen bleiben offen
1. Wenn ich einen Button erstelle, würde ich gerne den Text auf dem Button rechtsbündig machen
2. Die Fenstergröße ändert sich einmal. Doch dadurch verrutschen die Buttons und die Labels... Kann man die irgendiwe fest positionieren?
Mir ist klar, dass man die Buttons mit Abfragen, ob das Fenster größer als am Anfang ist und durch guictrlsetpos binden kann, doch ich hoffe auf eine einfachere Lösung
3. Ich habe zwei Gui-Tabs erstellt, die nicht anklickbar sein sollen (bis auf dem ersten ^^)
Soweit kam ich mit Guictrlsetstate auch schon, doch leider sehen die Tabs so aus, als ob man sie anklicken könnte, denn die Schrift ist schwarz und der Hintergrund normal.
Bei Textlabeln ist aber die Schriftart heller und der Hintergrund dunkler. Folglich sieht man sofort, dass man die Labels nicht anklicken kann.
Ich hätte also gerne das Design der Textlabels auf die Tabs übertragen
Nun, um das dritte Problem zu lösen, habe ich daher Labels auf die Tabs gesetzt. Allerdings sind mir die bei verschiedenen Bildschirmgrößen von den Tabs gerutscht und das Ergebnis sieht daher furchtbar aus
Spoiler anzeigen
#include <GuiConstantsEx.au3>
#include <AVIConstants.au3>
#include <TreeViewConstants.au3>
#include <StaticConstants.au3>
Opt('MustDeclareVars', 1)
Opt("GUIOnEventMode", 1)
Global $Name, $msg, $Rasse, $Rasse2, $Neu, $Exit, $Tab2, $Tab1
Global $laden, $x
GLobal $pos[2]
Global $size = 11.7, $font = "Arial"
[/autoit] [autoit][/autoit] [autoit]Example()
[/autoit] [autoit][/autoit] [autoit]Func Example()
[/autoit] [autoit][/autoit] [autoit]; GUI
GuiCreate("Meine Gui", 600, 400)
GUISetFont($Size, "", "", $Font)
$x = GuiCtrlCreateTab(0, 0, 600, 500)
Disable()
; Erster Tab
GuiCtrlCreateTabItem("Tab1")
$Neu = GuiCtrlCreatebutton("Erstellen", 266,47,160,27)
GUICtrlSetOnEvent($Neu, "OnNeu")
;GUICtrlSetStyle(-2, $SS_RIGHT)
$laden = Guictrlcreatebutton("Laden", 160, 47, 60, 27)
GUICtrlSetOnEvent($Laden, "OnLaden")
;GUICtrlSetStyle(-2, $SS_RIGHT)
Guictrlcreatelabel("oder", 223, 50)
GuiCTRlsetfont(-1, $size+0.5, "", 2)
$Exit = GUICtrlCreateButton("Exit", 340, 220, 50, 20)
GUICtrlSetOnEvent($Exit, "OnExit")
; Zweiter Tab
$Tab2 = GuiCtrlCreateTabitem("Tab2")
GUICtrlSetState($Tab2, $GUI_DISABLE)
GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit")
while(1)
Sleep(1000)
WEnd
EndFunc ;==>_Main
[/autoit] [autoit][/autoit] [autoit];--------------- Functions ---------------
Func OnNeu()
EndFunc
Func Onloeschen()
EndFunc
Func onLaden()
EndFunc
Func Disable()
Guictrlsetstate($x, $gui_disable)
GUICTRLSETFONT($x, 13)
;Guictrlsetbkcolor($x, 0xECE9D7) ;funktioniert leider nicht...
;GUICtrlSetColor($x, 0xECE9D7) ; ""
Guictrlcreatelabel("Tab2", 88,5,58, 20)
Guictrlsetstate(-1, $gui_disable)
GUICTRLSETFONT(-2, 12)
Endfunc
Func OnExit()
If @GUI_CtrlId = $Exit Then
Else
EndIf
Exit
EndFunc
Habe den Quelltext stark vereinfacht
Wäre toll, wenn jemand die Antworten wüsste
Liebe Grüße
Elodie