Jump to content

Recommended Posts

Posted

hello,

I try to create a _GUICtrlListView_Create inside a Tabitem without success.

Am I wrong or is not possible?

thanks to who can help me.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#Include <GuiEdit.au3>
Opt("GUIOnEventMode", 1)
$Form1_1 = GUICreate("Main Form", 623, 482, 354, 209)
$Input1 = GUICtrlCreateInput("", 8, 24, 57, 21)
GUICtrlSetOnEvent(-1, "Input1Change")
$Label1 = GUICtrlCreateLabel("Input box", 8, 5, 55, 17)

$Tab1 = GUICtrlCreateTab(8, 56, 601, 377)

$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")

; the following _GUICtrlListView_Create DO NOT APPEAR

$lstview = _GUICtrlListView_Create($TabSheet1, "Column 0|Column 1|Column 2|Column 3|Column 4", 15, 90, 500, 300) ; x, y, w, h
_GUICtrlListView_SetColumnWidth($lstview, 0, 100) ; Column 0
_GUICtrlListView_SetColumnWidth($lstview, 1, 100) ; Column 1
_GUICtrlListView_SetColumnWidth($lstview, 2, 100) ; Column 2
_GUICtrlListView_SetColumnWidth($lstview, 3, 100) ; Column 3
_GUICtrlListView_SetColumnWidth($lstview, 4, 100) ; Column 4
_GUICtrlListView_SetExtendedListViewStyle($lstview, $LVS_EX_GRIDLINES) ; a grid inside the _GUICtrlListView

$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")

$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")

GUICtrlCreateTabItem("")

GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func Form1_1Close()
Exit
EndFunc
Func Input1Change()
_GUICtrlListView_AddItem($lstview, _GUICtrlEdit_GetText($Input1)) ; just a test
EndFunc

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Posted

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#Include <GuiEdit.au3>
Opt("GUIOnEventMode", 1)
$Form1_1 = GUICreate("Main Form", 623, 482, 354, 209)
$Input1 = GUICtrlCreateInput("", 8, 24, 57, 21)
GUICtrlSetOnEvent(-1, "Input1Change")
$Label1 = GUICtrlCreateLabel("Input box", 8, 5, 55, 17)

$Tab1 = GUICtrlCreateTab(8, 56, 601, 377)

$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")

; the following _GUICtrlListView_Create DO NOT APPEAR

$lstview = GUICtrlCreateListView("Column 0|Column 1|Column 2|Column 3|Column 4", 15, 90, 500, 300) ; x, y, w, h
_GUICtrlListView_SetColumnWidth($lstview, 0, 100) ; Column 0
_GUICtrlListView_SetColumnWidth($lstview, 1, 100) ; Column 1
_GUICtrlListView_SetColumnWidth($lstview, 2, 100) ; Column 2
_GUICtrlListView_SetColumnWidth($lstview, 3, 100) ; Column 3
_GUICtrlListView_SetColumnWidth($lstview, 4, 100) ; Column 4
_GUICtrlListView_SetExtendedListViewStyle($lstview, $LVS_EX_GRIDLINES) ; a grid inside the _GUICtrlListView

$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")

$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")

GUICtrlCreateTabItem("")

GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func Form1_1Close()
Exit
EndFunc
Func Input1Change()
_GUICtrlListView_AddItem($lstview, _GUICtrlEdit_GetText($Input1)) ; just a test
EndFunc

Posted

Have you tried GUICtrlCreateListView? There are plenty of examples using Tabs and ListViews with the AutoIt native controls.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • Moderators
Posted

Pincopanco,

If you use UDF-created controls you need to deal with the hide/show code yourself: :)

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiEdit.au3>

Opt("GUIOnEventMode", 1)

$Form1_1 = GUICreate("Main Form", 623, 482, 354, 209)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close")

$Input1 = GUICtrlCreateInput("", 8, 24, 57, 21)
GUICtrlSetOnEvent(-1, "Input1Change")

$Label1 = GUICtrlCreateLabel("Input box", 8, 5, 55, 17)

$Tab1 = GUICtrlCreateTab(8, 56, 601, 377)
GUICtrlSetOnEvent($Tab1, "_Tab_Toggle")

$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")

$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")

$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")

GUICtrlCreateTabItem("")

$lstview = _GUICtrlListView_Create($Form1_1, "Column 0|Column 1|Column 2|Column 3|Column 4", 15, 90, 500, 300) ; x, y, w, h
_GUICtrlListView_SetColumnWidth($lstview, 0, 100) ; Column 0
_GUICtrlListView_SetColumnWidth($lstview, 1, 100) ; Column 1
_GUICtrlListView_SetColumnWidth($lstview, 2, 100) ; Column 2
_GUICtrlListView_SetColumnWidth($lstview, 3, 100) ; Column 3
_GUICtrlListView_SetColumnWidth($lstview, 4, 100) ; Column 4
_GUICtrlListView_SetExtendedListViewStyle($lstview, $LVS_EX_GRIDLINES) ; a grid inside the _GUICtrlListView

GUISetState(@SW_SHOW)

While 1
    Sleep(100)
WEnd

Func _Tab_Toggle()
    Switch GUICtrlRead($Tab1)
        Case 0
            ControlShow($Form1_1, "", $lstview)
        Case 1, 2
            ControlHide($Form1_1, "", $lstview)
    EndSwitch
EndFunc

Func Form1_1Close()
    Exit
EndFunc   ;==>Form1_1Close

Func Input1Change()
    _GUICtrlListView_AddItem($lstview, _GUICtrlEdit_GetText($Input1)) ; just a test
EndFunc   ;==>Input1Change

I recommend the Tabs tutorial in the Wiki if you want more information on how to work with tabs. ;)

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:

  Reveal hidden contents

 

Posted

looking at the solutions, now the concept is more clear for me

Thank you all

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

  • 2 weeks later...
Posted

GREAT!

That's what I was looking for!

Anyways, it looks that listview borders are missing ! :mellow:

I've tried with _GUICtrlListView_SetExtendedListViewStyle() without luck... :

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
  • Recently Browsing   0 members

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