Tab control focus

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
JohnBonnett88
Posts: 45
Joined: Mon Mar 07, 2022 12:34 am

Tab control focus

Post by JohnBonnett88 »

Hi All,

I am working on porting a large VO application, created by someone else, to X#. I don't have VO myself, although the organization has an old version that I might install if I get desperate.

I have got most things running fine now and am just chasing up some different behavior in a few GUIs. One I have an issue with is programmatically changing tabs on a tab control using SelectTab. When you select the tab, the runtime needs to construct the window which will be the new tab page, and also adjust the tab strip to indicate a new tab has been selected.

When the tab opens, the user expects the focus will be on a particular control, but it is not, even though the Show method for the window specifically sets it there. After some digging around, I believe what is happening is that the focus is actually set correctly as the window is shown, but the runtime then adjusts the tab strip, moving the focus to there, causing the control on the window to loose focus. This event is captured by the EditFocusChange method that correctly sets the focus to another control. The user then sees the focus on the logically second control rather than the expected first one.

Further digging in the VO documentation I have, tells me that I can set a style property for the tab strip that will prevent this unwanted focus change. It is the "Never focus" style, which says the tab strip never gets focus. I think this is likely a bit in the Style property of the tab strip, a long integer, but which bit!

I guess normally you use the VO GUI editor to manage these things, and never worry about which bit, but I don't have that.

Can anyone point me to appropriate documentation for these bits or even just tell me which bit I need to do this?

Failing that, I may need to install the old VO copy we have and play with a simple GUI to find the bit by trial and error.

Thanks in advance,
John
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Tab control focus

Post by Chris »

Hi John,

Unfortunately it's extremely difficult to tell, just from the description. Can you create and post a sample demonstrating the problem, so we can have a look?

Btw, the VOGUI window editor is available in the X# ported apps, too.

.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Post Reply