Jump to content

$WS_EX_MDICHILD with TAB


cramaboule
 Share

Recommended Posts

How to make it working porperly ???

the $hScroller GUI in NOT attached to the Tab1.

How to do that ?

Thanks

Cramy

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include "GUIScrollBars_Ex.au3"
#include "StringSize.au3"
#include <StaticConstants.au3>

$sText1 = "Lorem ipsum dolor sit amet, consectetur adipisicing elit,"; sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
$sText = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

$aText_Info = _StringSize($sText, Default, Default, Default, "", 183)

$hGUI = GUICreate("Test", 500, 200)
$tab = GUICtrlCreateTab(0, 0, 500, 200)
$tab0 = GUICtrlCreateTabItem("Tab1")
$HwndT0 = GUICtrlGetHandle($tab0)

$hScroller = GUICreate("Scroller", 200, 160, 100, 30,$WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$hLabel1 = GUICtrlCreateLabel($sText1, 10, 0, 183,40)
$hLabel2 = GUICtrlCreateLabel($aText_Info[0], 10, 41, 183, $aText_Info[3],Default, $WS_EX_DLGMODALFRAME)
_GUIScrollbars_Generate ($hScroller, 0, $aText_Info[3]+41)
GUISwitch($hGUI)

$tab1 = GUICtrlCreateTabItem("Tabt2")
$hLabel3 = GUICtrlCreateLabel($sText1, 10, 30, 183,40)

GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW ,$hGUI)
GUISetState(@SW_SHOW ,$hScroller)




While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Link to comment
Share on other sites

  • Moderators

cramaboule,

AutoIt only looks after controls created with GUICtrlCreate* commands automatically - if you put anything else in a tab you need to the hard work to hide/show it: ;)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include "GUIScrollBars_Ex.au3"
#include "StringSize.au3"
#include <StaticConstants.au3>

$sText1 = "Lorem ipsum dolor sit amet, consectetur adipisicing elit,"; sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
$sText = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

$aText_Info = _StringSize($sText, Default, Default, Default, "", 183)

$hGUI = GUICreate("Test", 500, 200)
$tab = GUICtrlCreateTab(0, 0, 500, 200)
$tab0 = GUICtrlCreateTabItem("Tab1")
$HwndT0 = GUICtrlGetHandle($tab0)

$tab1 = GUICtrlCreateTabItem("Tab2")
$hLabel3 = GUICtrlCreateLabel($sText1, 10, 30, 183, 40)

$hScroller = GUICreate("Scroller", 200, 160, 100, 30, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
$hLabel1 = GUICtrlCreateLabel($sText1, 10, 0, 183, 40)
$hLabel2 = GUICtrlCreateLabel($aText_Info[0], 10, 41, 183, $aText_Info[3], Default, $WS_EX_DLGMODALFRAME)
_GUIScrollbars_Generate($hScroller, 0, $aText_Info[3] + 41)
GUISwitch($hGUI)

GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW, $hGUI)
GUISetState(@SW_SHOW, $hScroller)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $tab
            Switch GUICtrlRead($tab)
                Case 0
                    GUISetState(@SW_SHOW, $hScroller)
                Case 1
                    GUISetState(@SW_HIDE, $hScroller)
            EndSwitch
    EndSwitch
WEnd

The Tabs tutorial in the Wiki covers this in more detail. :)

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

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...