| re: How to keep cursor within the scope of a custom user control ??
Kevin,
I finally applied this solution in an application that contained 3 custom
user controls layered on top of each other on a main from (frmMain).
I created a frmMain ArrayList of the user controls hosted by frmMain.
When one of the controls was selected by the user I passed the ArrayList
setting the UserControl.TabStop = false for all except the control that
was selected.
This worked partially in that it keep the cursor from jumping to the
unselcted user controls (overlayed in the z-order) by the selected control.
Unfortunately, the cursor still jumped from the selected user control to
frmMain when I tabbed past the last (tab index) textbox on the user control.
I tried setting the frmMain.TabStop = false but the cursor still jumped to
exposed (non-custom user) controls on the frmMain.
Finally to keep the cursor restricted to the selected user control. I had
to
set the TabStop = false for ALL controls (multiple buttons, textboxs, etc)
contained on the frmMain, not just the user controls.
This makes sense in that controls are controls but it makes cursor
management within a large complex application a real PIA. Since
my users want the cursor to stay within the selected user control until
they click on the main form. Once they click on the main form they
want to use the Tab Key to bounce around on the main form.
Anyway, thanks for your help in getting this far. It is very much
appreciated.
Barry
in Oregon
"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message
news:KY9OdJZhEHA.584@cpmsftngxa10.phx.gbl...[color=blue]
> Hi Barry,
>
> First of all, I would like to confirm my understanding of your issue. From
> your description, I understand that you need to prevent cursor from
> stopping on non-visible controls. If there is any misunderstanding, please
> feel free to let me know.
>
> Based on my experience, each user control will have a property named
> TabStop. If this property is set to true, the cursor will stop on this
> control when press tab key. So if you don't need to cursor to stop, we[/color]
just[color=blue]
> need to set this property to false on the invisible controls.
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>[/color] |