Jump to content

Creating controls in Tab items.


Recommended Posts

When I create a control in a tab item, it doesn't appear until the tab focus has been changed to another tab and then back to the one in which the control was created. Is there a workaround or fix for this? Thanks in advance!

Link to comment
Share on other sites

Edit: And I just realized I totally buggered that up, cus my test code didn't do what you said it should. I can successfully reproduce this, AND have a fix for it, take note of the GUICtrlCreateTabItem('') with the comments in my example below.

#include <GUIConstants.au3>

$gui = GUICreate('', 200, 200)
GUICtrlCreateTab(0,0,200,200)
    $tab = GUICtrlCreateTabItem('Test')
        GUICtrlCreateButton('Button', 50, 50, 100, 25)
    GUICtrlCreateTabItem('Test2')
        GUICtrlCreateInput('Input', 50, 50, 100, 25)
    GUICtrlCreateTabItem('')
GUISetState()

Sleep(2000)
WinSetTitle($gui, '', 'New button should appear...')
GUISwitch($gui, $tab)
    GUICtrlCreateButton('New Button', 50, 80, 100, 25)
    GUICtrlCreateTabItem('') ; Adding this will make the button appear right away.


While 1
    $gm = GUIGetMsg()
    Switch $gm
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd
Edited by Saunders
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...