Ultragrid - ctrl-TAB won't work out of UG in groupbox when on TabPage


Author
Message
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hey, the **** should be  S h i f t ... but I might have spelt it wrongly. BigGrin
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Yeah, I have been playing with it a lot too, but it is quite difficult to control this situation.

Anyway, I got a bit near... since you've got Infragistics, I used the UltraTabControl instead, and the reason was that I could set a mneumonic to its tab names, like Tab&1, Tab&2, which will show Tab1, Tab2. I also set the TabStop for the control as False. This way, you could tell your users that they need to Alt+1, Alt+2 and so on, using the mneumoics you assigned to the Tabs, to get them focused, and then the Tab key would allow them to navigate inside the controls you drop in each page, your UltraGrid for instance. To get out of them, they Alt+X the page again and use the ****+Tab to go to the previous control, and then Tab through the other controls outside the UltraTabControl as they wish...

What about that? w00t

Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Well, no joy so far. ProcessCmdKey gets the same results. I also have not been able to get to work using a panel manager instead of TabControl.



I think I need to subclass the TabControl and let the ctrl-TAB pass through to the grid as some of the other Ctrl combinations do ( my cntl-Delete I created works fine - Ctrl-E does not ) I thought it might be in the SF TabControl but there is no code in the SF controls handling keystrokes.



I have tried overriding ProcessCmdKey at the tabcontrol level to just return and not call the baseclass if the key combo is ctrl-tab but that doesn't work



The processcmdkey on the baseform still sees the the TAB as controlkey if it is combined with control ( just as the onkeydown does )



I'm really stuck and the interface pretty much depends on this working ( have a question up on Stackoverflow but no answers yet ) w00t



Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Sorry Ivan, I'm being an idiot. i went back to the original thread and saw the code you posted about processcmdkey.



I'll work with that and hopefully I can have this working by the time you get back to the office Blush

Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
There is no override of ProcessCmdKey anywhere in your sample but that seems to be the right direction. I tried this code in the MyBaseUltraGrid.vb



Protected Overloads Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean

Const WM_KEYDOWN As Integer = &H100

Const WM_SYSKEYDOWN As Integer = &H104



If (msg.Msg = WM_KEYDOWN) OrElse (msg.Msg = WM_SYSKEYDOWN) Then

Select Case keyData



Case (Keys.Control Or Keys.Tab)

SetFocusToNextControl(True)

Exit Select



Case (Keys.Control Or Keys.E)

SetFocusToNextControl(True)

Exit Select



End Select

Return (MyBase.ProcessCmdKey(msg, keyData))

End If



End Function




but just like the onkeydown code it is showing e.keycode as Contrlkey {17}



I've tried intercepting the keydown in the tabcontrol and tabpage but don't seem to have that figure out either.



It is definitely a problem with the tabcontrol (or page) catching the keystroke before it hits the Ultragrid but I'm in over my head on the process of events.



w00t



Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Charles.

I'm out of office right now and won't be able to test your sample fully, but one thing I noticed after a quick look is that on my original sample, I was dealing with keystrokes on the BaseForm, overriding the ProcessCmdKey, while you are dealing with it inside your BaseGrid. Guess that this could make a difference.

Talk to you later. Wink


Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
This is both interesting and frustrating ( like so many things in our profession Wink )



In the example the only change i have made to Ivan's clever trick of placing the UG in a groupbox which handles the TabOrderController is to put that groupbox on a TabPage ( and are all the ultragrids in my app )



ctrl-Tab seems reserved to move between tab pages. But ctrl-E is also a problem. Not sure where the focus goes, since in watch window it shows e.keycode is not keys.E but CntrlKey {17} ( this is also true when it is Cntrl-TAB )



Oddly, Ctrl-A, Ctrl-X etc work as expected. And my code in the OnKeydown to have cntrl-Delete delete the row works fine, so I am not sure how the keycode is getting intercepted by the TabControl..



Notice in the sample that if the TabControl is removed, the groupbox/ultragrid work exactly as in the original example.



I have not been able to figure out if this is a SF thing or just a .NET tabcontrol thing or where to intervene.



If it is not fixable I need to convert my app to use panels or something instead but before I go that direction I'd like to know this can't be fixed and that I am not going to have the same problem there.



Thanks in advance ( Ivan BigGrin )
Attachments
UtragridSample2.zip (166 views, 191.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search