You last visited: Today at 03:52
Advertisement
"FuncLabel" im Tab mit einbinden
Discussion on "FuncLabel" im Tab mit einbinden within the AutoIt forum part of the Coders Den category.
04/04/2013, 18:43
#1
elite*gold: 14
Join Date: Feb 2013
Posts: 129
Received Thanks: 2
"FuncLabel" im Tab mit einbinden
Ich würde gerne das das Label der Func-Funktion immer nur auf dem entsprechenden Tab angezeigt wird.
PHP Code:
#include <GUIConstantsEx.au3>
Opt ( "GUIOnEventMode" , 1 )
GUICreate ( "" , 400 , 300 , - 1 , - 1 )
GUISetOnEvent ( $GUI_EVENT_CLOSE , "_exit" )
GUICtrlCreateTab ( 0 , 0 , 400 , 300 )
GUICtrlCreateTabItem ( "Tab 1" )
GUICtrlCreateButton ( "Drück mich!" , 25 , 50 )
GUICtrlSetOnEvent (- 1 , "_start1" )
GUICtrlCreateTabItem ( "Tab 2" )
GUICtrlCreateButton ( "Drück mich!" , 25 , 50 )
GUICtrlSetOnEvent (- 1 , "_start2" )
GUICtrlCreateTabItem ( "" )
Func _start1 ()
GUICtrlCreateLabel ( "11111" , 25 , 75 )
EndFunc
Func _start2 ()
GUICtrlCreateLabel ( "22222" , 25 , 100 )
EndFunc
GUISetState ()
Func _exit ()
Exit
EndFunc
While 1
Sleep ( 100 )
WEnd
Ich bedanke mich schon mal im Vorraus für euere Antworten
meinselite
04/04/2013, 18:59
#2
elite*gold: 0
Join Date: Jan 2013
Posts: 426
Received Thanks: 129
Lösung:
Code:
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)
GUICreate("", 400, 300, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
$t1=GUICtrlCreateTab(0, 0, 400, 300)
$Ti1=GUICtrlCreateTabItem("Tab 1")
GUICtrlCreateButton("Drück mich!", 25, 50)
GUICtrlSetOnEvent(-1, "_start1")
$Ti2=GUICtrlCreateTabItem("Tab 2")
GUICtrlCreateButton("Drück mich!", 25, 50)
GUICtrlSetOnEvent(-1, "_start2")
$Ti3=GUICtrlCreateTabItem("")
$1=""
$2=""
$11=0
$21=0
Func _start1()
$1=GUICtrlCreateLabel("11111", 25, 75)
$11=1
EndFunc
Func _start2()
$2=GUICtrlCreateLabel("22222", 25, 100)
$21=1
EndFunc
GUISetState()
Func _exit()
Exit
EndFunc
While 1
If GUICtrlRead($t1)=0 And $21=1 Then
GUICtrlDelete($2)
$21=0
EndIf
If GUICtrlRead($t1)=1 And $11=1 Then
GUICtrlDelete($1)
$11=0
EndIf
Sleep(100)
WEnd
Logik: wenn man auf seite 2 ist und der text1 da ist dann text1 löschen. wenn man auf seite 1 ist und text2 da ist dann text2 löschen.
04/04/2013, 20:24
#3
elite*gold: 14
Join Date: Feb 2013
Posts: 129
Received Thanks: 2
Danke, habe garnicht so weit gedacht, ich Dummkopf.
meinselite
04/04/2013, 20:35
#4
elite*gold: 0
Join Date: Jan 2013
Posts: 426
Received Thanks: 129
Quote:
Originally Posted by
meinselite
Danke, habe garnicht so weit gedacht, ich Dummkopf.
meinselite
du bist kein dummkopf! niemand ist ein dummkopf! manchmal kommt man halt nicht so schnell auf eine idee! ich will hier keine wissenschaftsrede halten aber: das idee-haben hat viel mit warscheinlichkeiten zu tun!
04/04/2013, 20:37
#5
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
warum so umständlich?...
PHP Code:
Opt ( "GUIOnEventMode" , 1 ) GUICreate ( "" , 400 , 300 , - 1 , - 1 ) GUISetOnEvent (- 3 , "_exit" ) GUICtrlCreateTab ( 0 , 0 , 400 , 300 ) GUICtrlCreateTabItem ( "Tab 1" ) $label1 = GUICtrlCreateLabel ( "" , 25 , 75 , 50 , 17 ) GUICtrlCreateButton ( "Drück mich!" , 25 , 50 ) GUICtrlSetOnEvent (- 1 , "_start1" ) GUICtrlCreateTabItem ( "Tab 2" ) $label2 = GUICtrlCreateLabel ( "" , 25 , 100 , 50 , 17 ) GUICtrlCreateButton ( "Drück mich!" , 25 , 50 ) GUICtrlSetOnEvent (- 1 , "_start2" ) GUICtrlCreateTabItem ( "" ) GUISetState () Func _start1 () GUICtrlSetData ( $label1 , "1111" ) EndFunc ;==> _start1 Func _start2 () GUICtrlSetData ( $label2 , "2222" ) EndFunc ;==> _start2 Func _exit () Exit EndFunc ;==> _exit While 1 Sleep ( 100 ) WEnd
All times are GMT +2. The time now is 03:53 .