Jump to content
Sign in to follow this  

Should Tab or TabItem notify?

Recommended Posts

I think this was mentioned this before, but anyway: When a tabitem is clicked, the notification ID is for the main tab control itself.

Additionally, GuiCtrlRead on the tab returns the tabitem INDEX instead of the tabitem ID.....

I think the direct tabitem ID would be more useful...

#include <GuiConstants.au3>


$tab = GuiCtrlCreateTab(80, 80, 300, 200)
$t1 = GuiCtrlCreateTabItem("one")
    GuiCtrlCreateButton("example button", 200, 200)
$t2 = GuiCtrlCreateTabItem("two")
$t3 = GuiCtrlCreateTabItem("three")

GuiCtrlCreateLabel("TabItem ID's:  " & $t1 & ", " & $t2 & ", " & $t3, 10, 10)

While 1
    $msg = GUIGetMsg()
    ToolTip($msg, 0, 0)
    If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $tab Then
        MsgBox(4096,"Tab clicked", "Tad index is " & GuiCtrlRead($tab)) 

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post

Link to post
Share on other sites

Presently the correspondance between index and id is not done due to the fact that if a tabitem is deleted a renumbering occurs.

I left to the programmer the responsability to do that.

I agree it can be a good idea if not too costly. :)

Share this post

Link to post
Share on other sites

I had a use for it to notify the other day, but I worked around it. I think it would have made it alot easier though if it did notify.


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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...