Sign in to follow this  
Followers 0
BeverlyJones

VB.NET Tabcontrol Clicking

11 posts in this topic

Hi everyone!

I'm new here so please go easy on me lol

I am trying to create a VB.NET program to automate a few things such as clicking checkboxes and filling textboxes, both of these I can do from following tutorials on this forum.

The problem I am having is clicking on different tabs. From using the Info tool I get this information on the control:

>>>> Window <<<<
Title:    Options
Class:    WindowsForms10.window.8.app.0.2bf8098_r13_ad1
Position:    177, 0
Size:    843, 607
Style:    0x16CC0000
ExStyle:    0x00010100
Handle:    0x0000000000530AE0

>>>> Control <<<<
Class:    WindowsForms10.SysTabControl32.app.0.2bf8098_r13_ad1
Instance:    1
ClassnameNN:    WindowsForms10.SysTabControl32.app.0.2bf8098_r13_ad11
Name:    TabControl1
Advanced (Class):    [NAME:TabControl1]
ID:    2
Text:    
Position:    12, 12
Size:    803, 513
ControlClick Coords:    70, 13
Style:    0x56010840
ExStyle:    0x00000000
Handle:    0x00000000009E0B56

>>>> Mouse <<<<
Position:    90, 55
Cursor ID:    0
Color:    0xDBDBDB

I have tried the usual ControlClick function but the ID seems to change all the time, my question is...

Is there a way to find the ID on each load then click the control?

Sorry if I have not explained myself enough, but I am very new to AutoIt.

Many thanks in advance.

Bev

Share this post


Link to post
Share on other sites



Sorry to Bump, but any ideas?

Share this post


Link to post
Share on other sites

BeverlyJones,

I am confused. You say you want to write a VB.NET program - yet you post on the AutoIt forum and expect answers? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Hi, Yes of course, you can add refference to the AutoIt .dll file and use the functions.

Or am I way off?

Share this post


Link to post
Share on other sites

BeverlyJones,

All becomes clear - I shall move this to the AutoItX section of the forum. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Sorry, I am not the best at explaining myself.

Anyway....

Would you be able to advise me on how I can solve my problem?

Share this post


Link to post
Share on other sites

Melba23,

I am afraid not as I do not use the AutoIt.dll. But those who do look in this section and should be able to help you - please be patient. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

By the name of the tab control, it is obvious that you are attempting to automate a .Net application and they are naturally difficult to automate using standard Windows' techniques. You'll need to actually use accessibility APIs instead of normal control messages to get the best results.

Share this post


Link to post
Share on other sites

Hi Richard, Thank you for your reply.

Would it be possible for you to point me in the right direction.

Many thanks in advance.

Share this post


Link to post
Share on other sites

Since you are using VB.Net, it would be easiest to just use the Windows UI automation objects which are documented here http://msdn.microsoft.com/en-us/library/system.windows.automation.aspx

Share this post


Link to post
Share on other sites

#11 ·  Posted

Hi Richard, sorry for my delayed reply.

Thanks for all your help.

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