UTA Posted February 3, 2006 Share Posted February 3, 2006 Hi,I still get crazy with this code:expandcollapse popup#include <GUIConstants.au3> ; Mainform $MainFormHandle = GUICreate("Test", 320, 250, -1, -1, -1, $WS_EX_TOPMOST) $tab=GUICtrlCreateTab (10,10, 300, 230) $tab1=GUICtrlCreateTabitem ( "Historie") $ExportButton = GUICtrlCreateButton("", 247, 180, 42, 42, $BS_ICON) GUICtrlSetImage($ExportButton, "export.ico") GUICtrlSetTip($ExportButton,"exportieren...") GUICtrlCreateTabitem ("") ; end tabitem definition ; Export-Listview $ExportFormHandle = GUICreate("Auswertung",400,250,-1,-1,-1,$WS_EX_ACCEPTFILES) $listview = GUICtrlCreateListView ("Datum |beginn|ende |differenz ",10,35,330,195);,$LVS_REPORT) GUISetFont (7) ; smaller Text ; Hauptprozedur GUICtrlCreateListViewItem ("Testitem1|with|multi|columns", $listView) GUISetState (@SW_SHOW, $MainFormHandle) GUICtrlCreateListViewItem ("Testitem2|with|multi|columns", $listView) While 1 $msg = GUIGetMsg() ; ======================================== ; ======================================== If $msg = $ExportButton Then Export() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Exit Func Export() GUICtrlCreateListViewItem ("Testitem3|with|multi|columns", $listView) GUISetState (@SW_HIDE, $MainFormHandle) GUISetState (@SW_SHOW, $ExportFormHandle) While 1 $msgExport = GUIGetMsg() ; ======================================== ; ======================================== If $msgExport = $GUI_EVENT_CLOSE Then ExitLoop Wend GUISetState (@SW_HIDE, $ExportFormHandle) GUISetState (@SW_SHOW, $MainFormHandle) GUICtrlCreateListViewItem ("Testitem4|with|multi|columns", $listView) EndFuncAs you can see:Two forms (Mainform and Listview-Form)Mainform with button (calls the export-function), Listview-form with ...guess...listview Four lines on different positions in the code where I try to create a ListviewItemOnly one (the first) is shown up in the listviewI suppose that the problem is somewhere around "The order of creating and showing different GUIItems", but I did not find any hints to maintain a special order. All searching in this forum and the helpfile did not get me the answer for this crazy behaviour. Do YOU have it?UTA(btw: do not wonder about the style of the code, I deleted everything not necessary to point to the problem) Link to comment Share on other sites More sharing options...
Valuater Posted February 3, 2006 Share Posted February 3, 2006 you were missing a GUISetState() expandcollapse popup#include <GUIConstants.au3> ; Mainform $MainFormHandle = GUICreate("Test", 320, 250, -1, -1, -1, $WS_EX_TOPMOST) $tab = GUICtrlCreateTab(10, 10, 300, 230) $tab1 = GUICtrlCreateTabItem("Historie") $ExportButton = GUICtrlCreateButton("", 247, 180, 42, 42, $BS_ICON) GUICtrlSetImage($ExportButton, "export.ico") GUICtrlSetTip($ExportButton, "exportieren...") GUICtrlCreateTabItem("") ; end tabitem definition ; Export-Listview $ExportFormHandle = GUICreate("Auswertung", 400, 250, -1, -1, -1, $WS_EX_ACCEPTFILES) $listview = GUICtrlCreateListView("Datum |beginn|ende |differenz ", 10, 35, 330, 195);,$LVS_REPORT) GUISetFont(7) ; smaller Text GUISetState(@SW_HIDE, $ExportFormHandle) ; Hauptprozedur GUICtrlCreateListViewItem("Testitem1|with|multi|columns", $listview) GUISetState(@SW_SHOW, $MainFormHandle) GUICtrlCreateListViewItem("Testitem2|with|multi|columns", $listview) While 1 $msg = GUIGetMsg() ; ======================================== ; ======================================== If $msg = $ExportButton Then Export() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Exit Func Export() GUICtrlCreateListViewItem("Testitem3|with|multi|columns", $listview) GUISetState(@SW_HIDE, $MainFormHandle) GUISetState(@SW_SHOW, $ExportFormHandle) While 1 $msgExport = GUIGetMsg() ; ======================================== ; ======================================== If $msgExport = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUISetState(@SW_HIDE, $ExportFormHandle) GUISetState(@SW_SHOW, $MainFormHandle) GUICtrlCreateListViewItem("Testitem4|with|multi|columns", $listview) EndFunc ;==>Export i noticed it kept making more and more lists 8) Link to comment Share on other sites More sharing options...
UTA Posted February 3, 2006 Author Share Posted February 3, 2006 Perhaps I'm blind but I recognized only one new GUISetState-Command (right at the end of the Export-Listview-Block). But first, it did not help really, did I do something wrong? And second I'm wondering if this is really necessary because the helpfile says that the initial state of every created GUI is @SW_HIDE. So why should I hide anything already hided? I'm getting more confused than before Link to comment Share on other sites More sharing options...
UTA Posted February 3, 2006 Author Share Posted February 3, 2006 (edited) you were missing a GUISetState()Sorry, I tried to copy and paste your whole code in a new project. It still has the problem that there is only one item in the listview although it must be four items ?!So this does not help really.Anyone any other suggestion?UTA Edited February 3, 2006 by UTA Link to comment Share on other sites More sharing options...
UTA Posted February 3, 2006 Author Share Posted February 3, 2006 I found a workaround: IT ONLY WORKS WITH THE BETA. Thanx anyway (How could I know that all of you are working with the beta!). UTA 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