Jump to content

tabsheet problem with listview destroy


Recommended Posts

hi  gut  i have little proble

i have created  a script   with  2 tabsheet .

in first tabsheet  i  have created  a  list view , when i clik one button i want destroy list view and  recreate  i  use  this  code

_GUICtrlListView_Destroy($List1AC)

$List1AC = GUICtrlCreateListView("Nome o Ditta|Mail|Telefono|Cell|Indirizzo|Città|Fax|Cod.DB", 501, 76, 545, 409,  $LVS_EX_GRIDLINES)
    _GUICtrlListView_SetExtendedListViewStyle($List1AC, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES, $LVS_EX_SUBITEMIMAGES)) ; questa stringa fa la griglia stile excel
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100) ; nome ditta
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100) ; mail
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 80) ; telefono
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 80) ; cell
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 100) ; indirizzo
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 5, 80) ; citta
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 6, 80) ; fax
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 30) ; cod.db

and  do  perfect  but  if   i after clik over  tabsheet2  the listview appear  also in tabsheet 2  is  possible tell at  listview only in tabsheet 1  you must appear?? :)

Link to comment
Share on other sites

  • Moderators

faustf,

You need to use GUISwitch with the tabitemID parameter to get the control onto the correct tab - and do not forget to close the tab definition once you have recreated it. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

faustf,

Sure: ;)

#include <GUIConstantsEx.au3>

$hGUI = GUICreate("Test", 500, 500)

$cTab = GUICtrlCreateTab(10, 10, 480, 350)
$cTab_0 = GUICtrlCreateTabItem("Tab 0")
$cTab_1 = GUICtrlCreateTabItem("Tab 1")
GUICtrlCreateTabItem("")

$cButton = GUICtrlCreateButton("Add to Tab(s)", 10, 450, 80, 30)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cButton
            ; This control will only be on Tab 0
            GUISwitch($hGUI, $cTab_0)
            GUICtrlCreateLabel("Only on Tab 0", 40, 40, 200, 20)
            GUICtrlSetBkColor(-1, 0xCCFFCC)
            GUICtrlCreateTabItem("")
            GUISwitch($hGUI)
            ; But this one will be on both
            GUICtrlCreateLabel("OnTab 0 AND Tab 1", 40, 100, 200, 20)
            GUICtrlSetBkColor(-1, 0xFFCCCC)
    EndSwitch

WEnd

If you create native controls outside the tab creation structure then they appear on all tabs (as is the case for all UDF-created controls).  So you need to use GUISwitch to get the controls into the tab structure if you create them after the tabs have been created. All clear? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

faustf,

 

I have added the example to the Tabs tutorial in the Wiki. :)

 

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...