Jump to content
Sign in to follow this  
BananaFredSoft

Creating controls in Tab items.

Recommended Posts

BananaFredSoft

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!

Share this post


Link to post
Share on other sites
therks

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.