Jump to content

Recommended Posts

Posted (edited)

I have a child window inside of my main window that has a tab control with a scrollbar. Everything is working fine except for a few little annoyances. When I minimize the window it works fine, but when I click on the window to bring it back I see the child window display instantly and then the parent window comes in behind it a second later. Also, I have another issue that when the window is open for a while and I come back to it the child window is shifted to the right and is extending outside the bounds of the parent window. I have not been able to narrow down when this happens, but it has happened quite a few times. If someone has a chance please take a look and see if you see the same thing. Thanks.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <TabConstants.au3>
#include <GUIScrollbars_Ex.au3>
#include <StringSize.au3>
#include <EditConstants.au3>
#include <ComboConstants.au3>
$xWidth = 800
$xHeight = 600
$iPadRight = 20
$iPadBottom = 20
$eColor = 0x80FF80
$oColor = 0xffffff
$Form1 = GUICreate("My GUI", $xWidth, $xHeight) ; will create a dialog box that when displayed is centered
$tab1 = GUICtrlCreateTab(0,10,$xwidth,490)
$t1 = GUICtrlCreateTabItem("Tab 1")
$t2 = GUICtrlCreateTabItem("Tab 2")
$t3 = GUICtrlCreateTabItem("Tab 3")
$t4 = GUICtrlCreateTabItem("Tab 4")
$t5 = GUICtrlCreateTabItem("Tab 5")
$t6 = GUICtrlCreateTabItem("Tab 6")
GUICtrlCreateTabItem("")
$hTab_Win0 = GUICreate("Test", $xWidth - 20, 400, 10, 50, $WS_POPUP, $WS_EX_MDICHILD, $Form1)
GUISetBkColor(0xffffff)
_GUIScrollbars_Generate($hTab_Win0, 0,400)
GUISetState(@SW_SHOW, $Form1)
GUISetState(@SW_SHOW, $hTab_Win0)
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $Tab1 Then _Tab()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
GUIDelete($hTab_Win0)
GUIDelete($Form1)
Func _Tab()
    Switch GUICtrlRead($tab1)
        Case 0
            GUISetState(@SW_SHOW, $hTab_Win0)
        Case 1
            GUISetState(@SW_HIDE, $hTab_Win0)
  Case 2
   GUISetState(@SW_HIDE, $hTab_Win0)
  Case 3
   GUISetState(@SW_HIDE, $hTab_Win0)
  Case 4
   GUISetState(@SW_HIDE, $hTab_Win0)
  Case 5
   GUISetState(@SW_HIDE, $hTab_Win0)
EndSwitch
EndFunc
Edited by notta
Posted (edited)

Hello Notta i tested your script but it runs ok with no problems...

I use xp sp3... i just say that because i had read in the forum that some times Gui's looks different in xp or w7...

Maybe im wrong but it works fine...

Edited by armoros

[font="verdana, geneva, sans-serif"] [/font]

  • Moderators
Posted

notta,

I too see no problems when minimizing/restoring the GUI nor any displacement of the child GUI (after about 20 minutes visible). I am using Vista x32. ;)

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

 

Posted

Thanks guys. The issue is happening on my Windows 7 machine. I have verified that the child window delay does not happen on Windows XP. I built the test file and had a co-worker run it on his Windows 7 machine and he also sees the delay. I don't have a Vista machine so I can't test that. Anyone have a 7 box they can test it on?

Posted (edited)

I did testit in my sisters w7 x32 pc i executed compiled but no problem..

here is the screenshots

XP-sp3 post-71357-0-00461400-1336585768_thumb.p

w7 x 32 post-71357-0-87882200-1336585824_thumb.p

I am sorry notta i am fool ;) my sister has Vista x32 too :)

sorry would love to help but.....

Edited by armoros

[font="verdana, geneva, sans-serif"] [/font]

Posted (edited)

haha, thanks anyway man. I have verified it on a 3rd Windows 7 machine so something is wrong.

Edited by notta
Posted

Dont know if that helps notta but try this...you never know...

Pass the Handle of the Parent GUI to the Child GUI using the 'Parent Parameter' and then Disable the Parent GUI.

GUICreate ( "title" [, width [, height [, left [, top [, style [, exStyle [, parent]]]]]]] )

Example

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GUIConstantsEx.au3>
Global $hParentGUI
_Main()
Func _Main()
    Local $iButton_1
    $hParentGUI = GUICreate("Example by guinness", 200, 200, -1, -1)
    $iButton_1 = GUICtrlCreateButton("Show MsgBox()", 10, 10, 85, 25)
    GUISetState(@SW_SHOW, $hParentGUI)
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $iButton_1
                GUISetState(@SW_DISABLE, $hParentGUI)
                _ChildGUI()
                GUISetState(@SW_ENABLE, $hParentGUI)
        EndSwitch
    WEnd
EndFunc   ;==>Main
Func _ChildGUI()
    GUICreate("Custom MsgBox()", 200, 200, -1, -1, -1, -1, $hParentGUI)
    GUISetState()
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                GUIDelete()
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>_ChildGUI

[font="verdana, geneva, sans-serif"] [/font]

Posted (edited)

Hey Notta i know im not helpful but here is a last thing you should try if you wish untill someone with w7 and better knowledge than me help you better...

page__view__findpost__p__975594

GUICtrlCreateTabitem("")

;)

Edited by armoros

[font="verdana, geneva, sans-serif"] [/font]

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