Sign in to follow this  
Followers 0
Orca

Guictrlread and TabItems

3 posts in this topic

#1 ·  Posted (edited)

I'm trying to get the text of a tabitem that does not have a reference field to it. There is, however, a reference to the overarching Tab

ConsoleWrite ( GuiCtrlRead ( GuiCtrlRead ( $Tabs, 1 ) ) )

The inner read gets the ControlID for the currently active tabitem. The second one should read from that tabitem. Unfortunately this returns a black string for both normal and advance reads. Any other suggestions?

Further the code

GuiCreate ( "" )
GuiCtrlCreateTab ( 0, 0 )
$a = GuiCtrlCreateTabItem ( "asdf" )
ConsoleWrite ( "[" )
ConsoleWrite ( GuiCtrlRead ( $a ) )
ConsoleWrite ( "]" )

Prints out "[]". So either this is a bug on the GuiCtrlRead'ing of TabItems or there is another approach to this (that isn't completely convoluted)

Edited by SiC_Goat

I AM ORCA!! A VERY POWERFUL WHALE!!!

Share this post


Link to post
Share on other sites



I'm trying to get the text of a tabitem that does not have a reference field to it. There is, however, a reference to the overarching Tab

ConsoleWrite ( GuiCtrlRead ( GuiCtrlRead ( $Tabs, 1 ) ) )

The inner read gets the ControlID for the currently active tabitem. The second one should read from that tabitem. Unfortunately this returns a black string for both normal and advance reads. Any other suggestions?

Further the code

GuiCreate ( "" )
GuiCtrlCreateTab ( 0, 0 )
$a = GuiCtrlCreateTabItem ( "asdf" )
ConsoleWrite ( "[" )
ConsoleWrite ( GuiCtrlRead ( $a ) )
ConsoleWrite ( "]" )

Prints out "[]". So either this is a bug on the GuiCtrlRead'ing of TabItems or there is another approach to this (that isn't completely convoluted)

Hi!

#include <GuiConstants.au3>
#include <GuiTab.au3>

$hGui = GUICreate("Test GUI", 300, 200)

$Tab = GuiCtrlCreateTab ( 0, 0 )
$a = GuiCtrlCreateTabItem ( "asdf" )
$a = GuiCtrlCreateTabItem ( "" )

ConsoleWrite(_GUICtrlTab_GetItemText($Tab, 0))

GUISetState()

Do
Until GUIGetMsg() = -3

:)

Share this post


Link to post
Share on other sites

Clearly I should be opening the help file with teh UDFs in it :) thanks a ton!


I AM ORCA!! A VERY POWERFUL WHALE!!!

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  
Followers 0