Killer Posted August 6, 2005 Share Posted August 6, 2005 (edited) Can someone enlighten me? I am trying to make a simple menus to perform some functions. The result will displayed does not go away when I clicked on a different tab. Can someone help me? #include <GUIConstants.au3> ;===== my column position setting ;GuiCtrlCreateLabel("Admins right detected", 150, 60, 130, 60) left, top, width, height $num1=150 $num2=60 $num3=130 $num4=60 ;GUICtrlSetState(-1,$GUI_HIDE) clearscreem GUICreate("My GUI menu",300,200) Global $defaultstatus = "runas: "&@UserName Global $status ; MENU $filemenu = GUICtrlCreateMenu ("&File") $fileitem = GUICtrlCreateMenuitem ("Open",$filemenu) GUICtrlSetState(-1,$GUI_DEFBUTTON) $helpmenu = GUICtrlCreateMenu ("?") $saveitem = GUICtrlCreateMenuitem ("Save",$filemenu) GUICtrlSetState(-1,$GUI_DISABLE) $infoitem = GUICtrlCreateMenuitem ("Info",$helpmenu) $exititem = GUICtrlCreateMenuitem ("Exit",$filemenu) $recentfilesmenu = GUICtrlCreateMenu ("Recent Files",$filemenu,1) $separator1 = GUICtrlCreateMenuitem ("",$filemenu,2) ; create a separator line $viewmenu = GUICtrlCreateMenu("View",-1,1) ; is created before "?" menu $viewstatusitem = GUICtrlCreateMenuitem ("Statusbar",$viewmenu) GUICtrlSetState(-1,$GUI_CHECKED) ;$okbutton = GUICtrlCreateButton ("OK",50,130,70,20) GUICtrlSetState(-1,$GUI_FOCUS) $quitbutton = GUICtrlCreateButton ("Quit",-180,130,70,20) ;button hidden $statuslabel = GUICtrlCreateLabel ($defaultstatus,0,165,300,16,BitOr($SS_SIMPLE,$SS_SUNKEN)) ; TAB GuiCtrlCreateTab(2, 0, 298, 160) GuiCtrlCreateTabItem("Network") ;GuiCtrlCreateLabel("Sample Tab with tabItems", 10, 40) $chkadminbutton = GUICtrlCreateButton ("Check Admin",10,28,80,20) $chkIPbutton = GUICtrlCreateButton ("Check IP",10,58,80,20) $chkcomputernamebutton = GUICtrlCreateButton ("Computername",10,88,80,20) GuiCtrlCreateTabItem("Two") GuiCtrlCreateLabel("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 4, 60, 298, 160) $chkadminbutton1 = GUICtrlCreateButton ("Check Admin",10,28,80,20) $chkIPbutton1 = GUICtrlCreateButton ("Check IP",10,58,80,20) $chkcomputernamebutton1 = GUICtrlCreateButton ("Computername",10,88,80,20) GuiCtrlCreateTabItem("Three") GuiCtrlCreateTabItem("") GUISetState () While 1 $msg = GUIGetMsg() If $msg = $fileitem Then $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") If @error <> 1 Then GUICtrlCreateMenuitem ($file,$recentfilesmenu) EndIf ; If $msg = $viewstatusitem Then ; If BitAnd(GUICtrlRead($viewstatusitem),$GUI_CHECKED) = $GUI_CHECKED Then ; GUICtrlSetState($viewstatusitem,$GUI_UNCHECKED) ; GUICtrlSetState($statuslabel,$GUI_HIDE) ; Else ; GUICtrlSetState($viewstatusitem,$GUI_CHECKED) ; GUICtrlSetState($statuslabel,$GUI_SHOW) ; EndIf ; EndIf If $msg = $GUI_EVENT_CLOSE Or $msg = $quitbutton Or $msg = $exititem Then ExitLoop If $msg = $infoitem Then Msgbox(0,"Info","Only a test...") ; SYS TOOL TAB Select GUICtrlSetState(-1,$GUI_HIDE) Case $msg = $chkadminbutton ;GuiCtrlCreateLabel("Admins right detected", 150, 60, 130, 60) left, top, leftend, bottomend If IsAdmin() Then GuiCtrlCreateLabel("Admins right detected", $num1, $num2, $num3, $num4) else GuiCtrlCreateLabel("No admins right detected", $num1, $num2, $num3, $num4) endif Case $msg = $chkIPbutton GuiCtrlCreateLabel(@IPAddress1 & @CRLF, $num1, $num2, $num3, $num4) Case $msg = $chkcomputernamebutton GuiCtrlCreateLabel(@ComputerName & @CRLF, $num1, $num2, $num3, $num4) EndSelect WEnd GUIDelete() Exit Edited August 6, 2005 by Killer Link to comment Share on other sites More sharing options...
Killer Posted August 6, 2005 Author Share Posted August 6, 2005 Even when I changed it to inputbox, it doesn't go away when I click on Tab 2. Link to comment Share on other sites More sharing options...
Amen Posted August 6, 2005 Share Posted August 6, 2005 When you create a conrtol use $Variable_1=Guicreate... The $Variable_1 stores the Id of that object. In this id you will update your data.Dont recreate the oblject beause it will be create on the Last Tabmenu you've created. Plugged ThoughtsQBsick? check my Old staff (New Launchers to Work with Windows.Thnx to Autoit!)Game Development ToolsPortes (A Backgammon game)Ball (An Arkanoid Style game)Au3? SecretProgz - Reveals Commands that can be used on your system CleanOut - Uninstall leftovers Enable windows XP Autologon. Stop Windows Auto Sharing your hard drives (C$,D$,etc) D-Link - Create a dynamic link.Useful for server shortcuts Fun - How would your name sounds in Japanese,Russian or Reventian? Fix_srt - Shift a subtitle (.srt) some secs +/- Link to comment Share on other sites More sharing options...
Killer Posted August 6, 2005 Author Share Posted August 6, 2005 When you create a conrtol use $Variable_1=Guicreate...The $Variable_1 stores the Id of that object.In this id you will update your data.Dont recreate the oblject beause it will becreate on the Last Tabmenu you've created.<{POST_SNAPBACK}>Can you modify my code to show me? I really don't understand and your codes doesn't seems to work. Link to comment Share on other sites More sharing options...
Amen Posted August 6, 2005 Share Posted August 6, 2005 (edited) Here it is expandcollapse popup#include <GUIConstants.au3> ;===== my column position setting ;GuiCtrlCreateLabel("Admins right detected", 150, 60, 130, 60) left, top, width, height $num1=150 $num2=60 $num3=130 $num4=60 ;GUICtrlSetState(-1,$GUI_HIDE) clearscreem $Maingui=GUICreate("My GUI menu",300,200) Global $defaultstatus = "runas: "&@UserName Global $status ; MENU $filemenu = GUICtrlCreateMenu ("&File") $fileitem = GUICtrlCreateMenuitem ("Open",$filemenu) GUICtrlSetState(-1,$GUI_DEFBUTTON) $helpmenu = GUICtrlCreateMenu ("?") $saveitem = GUICtrlCreateMenuitem ("Save",$filemenu) GUICtrlSetState(-1,$GUI_DISABLE) $infoitem = GUICtrlCreateMenuitem ("Info",$helpmenu) $exititem = GUICtrlCreateMenuitem ("Exit",$filemenu) $recentfilesmenu = GUICtrlCreateMenu ("Recent Files",$filemenu,1) $separator1 = GUICtrlCreateMenuitem ("",$filemenu,2); create a separator line $viewmenu = GUICtrlCreateMenu("View",-1,1); is created before "?" menu $viewstatusitem = GUICtrlCreateMenuitem ("Statusbar",$viewmenu) GUICtrlSetState(-1,$GUI_CHECKED) ;$okbutton = GUICtrlCreateButton ("OK",50,130,70,20) GUICtrlSetState(-1,$GUI_FOCUS) $quitbutton = GUICtrlCreateButton ("Quit",-180,130,70,20);button hidden $statuslabel = GUICtrlCreateLabel ($defaultstatus,0,165,300,16,BitOr($SS_SIMPLE,$SS_SUNKEN)) ; TAB GuiCtrlCreateTab(2, 0, 298, 160) GuiCtrlCreateTabItem("Network") ;GuiCtrlCreateLabel("Sample Tab with tabItems", 10, 40) $chkadminbutton = GUICtrlCreateButton ("Check Admin",10,28,80,20) $chkIPbutton = GUICtrlCreateButton ("Check IP",10,58,80,20) $chkcomputernamebutton = GUICtrlCreateButton ("Computername",10,88,80,20) $Label_1= GuiCtrlCreateLabel("", $num1, $num2, $num3, $num4) GuiCtrlCreateTabItem("Two") $chkadminbutton1 = GUICtrlCreateButton ("Check Admin",10,28,80,20) $chkIPbutton1 = GUICtrlCreateButton ("Check IP",10,58,80,20) $chkcomputernamebutton1 = GUICtrlCreateButton ("Computername",10,88,80,20) $Label_2=GuiCtrlCreateLabel("", $num1, $num2, $num3, $num4) GuiCtrlCreateTabItem("Three") $Label_3=GuiCtrlCreateLabel("", $num1, $num2, $num3, $num4) GuiCtrlCreateTabItem("") GUISetState () While 1 $msg = GUIGetMsg() If $msg = $fileitem Then $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") If @error <> 1 Then GUICtrlCreateMenuitem ($file,$recentfilesmenu) EndIf ; If $msg = $viewstatusitem Then ; If BitAnd(GUICtrlRead($viewstatusitem),$GUI_CHECKED) = $GUI_CHECKED Then ; GUICtrlSetState($viewstatusitem,$GUI_UNCHECKED) ; GUICtrlSetState($statuslabel,$GUI_HIDE) ; Else ; GUICtrlSetState($viewstatusitem,$GUI_CHECKED) ; GUICtrlSetState($statuslabel,$GUI_SHOW) ; EndIf ; EndIf If $msg = $GUI_EVENT_CLOSE Or $msg = $quitbutton Or $msg = $exititem Then ExitLoop If $msg = $infoitem Then Msgbox(0,"Info","Only a test...") ; SYS TOOL TAB Select ;GUICtrlSetState($Maingui,$GUI_HIDE) Case $msg = $chkadminbutton ;GuiCtrlCreateLabel("Admins right detected", 150, 60, 130, 60) left, top, leftend, bottomend If IsAdmin() Then GUICtrlSetData($Label_1,"Admins right detected") else GUICtrlSetData($Label_1,"No Admins right detected") endif Case $msg = $chkIPbutton GUICtrlSetData($Label_1,@IPAddress1) Case $msg = $chkcomputernamebutton GUICtrlSetData($Label_1,@ComputerName) EndSelect WEnd GUIDelete() Exit Edited August 6, 2005 by Amen Plugged ThoughtsQBsick? check my Old staff (New Launchers to Work with Windows.Thnx to Autoit!)Game Development ToolsPortes (A Backgammon game)Ball (An Arkanoid Style game)Au3? SecretProgz - Reveals Commands that can be used on your system CleanOut - Uninstall leftovers Enable windows XP Autologon. Stop Windows Auto Sharing your hard drives (C$,D$,etc) D-Link - Create a dynamic link.Useful for server shortcuts Fun - How would your name sounds in Japanese,Russian or Reventian? Fix_srt - Shift a subtitle (.srt) some secs +/- Link to comment Share on other sites More sharing options...
Killer Posted August 6, 2005 Author Share Posted August 6, 2005 Thanks for helping out a newbie. Link to comment Share on other sites More sharing options...
Amen Posted August 6, 2005 Share Posted August 6, 2005 Thanks for helping out a newbie. <{POST_SNAPBACK}>Hey I'm the niewbe here not you! Plugged ThoughtsQBsick? check my Old staff (New Launchers to Work with Windows.Thnx to Autoit!)Game Development ToolsPortes (A Backgammon game)Ball (An Arkanoid Style game)Au3? SecretProgz - Reveals Commands that can be used on your system CleanOut - Uninstall leftovers Enable windows XP Autologon. Stop Windows Auto Sharing your hard drives (C$,D$,etc) D-Link - Create a dynamic link.Useful for server shortcuts Fun - How would your name sounds in Japanese,Russian or Reventian? Fix_srt - Shift a subtitle (.srt) some secs +/- Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now