tonycst Posted October 13, 2014 Share Posted October 13, 2014 I have a listview and some other items i want to use for next tab. How do i go about doing it in a way that both tabs will have it working exactly same way and effecting both tabs as well (or more tabs) ? Thanks in advance. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 13, 2014 Moderators Share Posted October 13, 2014 tonycst,Having the same controls on several tabs seems a strange way to go about things as the idea of tabs is to show separate controls. If you want the controls to be identical than you will need to create 2 sets and action both together whenever they change. But why not place the ListView et al outside the tab so that they are visible regardless of the tab selected? Or you might think about creating them outside the tab creation structure and then managing their visibility depending on the tab selected - see the Tabs tutorial in the Wiki to see what I mean. If you could give us a few more details on exactly what the GUI and tabs are supposed to contain we might be able to offer some better advice on how best to achieve your goal. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
tonycst Posted October 13, 2014 Author Share Posted October 13, 2014 (edited) But why not place the ListView et al outside the tab so that they are visible regardless of the tab selected? I knew about this ! I had it done few times in the past but thought it was a bug. Question. List view loads available drives. Once drive is clicked, it updates other controls with drive information. Update is only working when in main tab, but other 2 tabs seem to have no effect when i click the drive from listview, as if listview is ignored for all other tabs. Listview and all its controls are created before any tabs as you suggested. I can see them in all tabs, but they work only for 1st tab. Edited October 13, 2014 by tonycst Link to comment Share on other sites More sharing options...
kylomas Posted October 13, 2014 Share Posted October 13, 2014 (edited) tonycst, This updates from any tab...maybe you have to create all tabs before LV population...note the "case 0" to prevent running the LV code if nothing is selected... #include <GUIConstantsEx.au3> #include <array.au3> #include <GuiListView.au3> #AutoIt3Wrapper_Add_Constants=n local $gui010 = guicreate('') local $aSize = wingetclientsize($gui010) local $tab = guictrlcreatetab(20,20,$aSize[0]-40,$aSize[1]-40) local $tb010 = guictrlcreatetabitem('ONE') guictrlcreatetabitem('') local $tb020 = guictrlcreatetabitem('TWO') guictrlcreatetabitem('') local $tb030 = guictrlcreatetabitem('THREE') guictrlcreatetabitem('') ; this listview will appear on every tab local $lst010 = guictrlcreatelistview('Select To Change - Select Again to Change Back',30,$aSize[1]-150,$aSize[0]-60,110) for $1 = 1 to 5 guictrlcreatelistviewitem('Item' & stringformat('%03i',$1),$lst010) next _GUICtrlListView_SetColumnWidth($lst010,0,$LVSCW_AUTOSIZE_USEHEADER) guisetstate() while 1 switch guigetmsg() case 0 ; this prevents running the LV case if nothing is selected continueloop case $gui_event_close Exit case guictrlread($lst010) guictrlsetdata(guictrlread($lst010),guictrlread(guictrlread($lst010)) = 'Changed Item|' ? 'Item' & stringformat('%03i',guictrlread($lst010)-7) : 'Changed Item') EndSwitch WEnd @M23 - Thanks, I didn't know this worked! Edited October 15, 2014 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill 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