how to set focus to first active control in frame 
Author Message
 how to set focus to first active control in frame

Hello,

I have the following problem.

I have a frame which contains several controls. I want to set the focus to
the first active control from the frame (ie the control with the lowest
tabindex, which can get the focus). I can give a control the focus with the
SetFocus method, but how do I know which control should get this focus? Note
that there can be in this frame controls which act as a container for other
controls, so it could also be one of these. I started with a routine which
enumerates over all controls of the frame container, but this doesn't find
the controls which are again part of a container (ex another frame). Is
there an easy method to accomplish this task?

Thanks in advance.

Peter Notebaert

peno1<at>mail<dot>com



Mon, 26 Apr 2004 00:59:29 GMT  
 how to set focus to first active control in frame
On Wed, 7 Nov 2001 17:59:29 +0100, "nnrp.news.eu.psi.net"

Can you do away with the main frame and use a picture box instead ?
If so, you could set focus to the picturebox, then sendkey in a tab.
picMain.SetFocus
SendKeys "{TAB}"

Quote:

>I have a frame which contains several controls. I want to set the focus to
>the first active control from the frame (ie the control with the lowest
>tabindex, which can get the focus). I can give a control the focus with the
>SetFocus method, but how do I know which control should get this focus? Note
>that there can be in this frame controls which act as a container for other
>controls, so it could also be one of these. I started with a routine which
>enumerates over all controls of the frame container, but this doesn't find
>the controls which are again part of a container (ex another frame). Is
>there an easy method to accomplish this task?

>Thanks in advance.

>Peter Notebaert

>peno1<at>mail<dot>com

Regards, Frank


Mon, 26 Apr 2004 06:31:49 GMT  
 how to set focus to first active control in frame
Maybe I can. I will try it. Thanks for the hint.

Peter


Quote:
> On Wed, 7 Nov 2001 17:59:29 +0100, "nnrp.news.eu.psi.net"

> Can you do away with the main frame and use a picture box instead ?
> If so, you could set focus to the picturebox, then sendkey in a tab.
> picMain.SetFocus
> SendKeys "{TAB}"

> >I have a frame which contains several controls. I want to set the focus
to
> >the first active control from the frame (ie the control with the lowest
> >tabindex, which can get the focus). I can give a control the focus with
the
> >SetFocus method, but how do I know which control should get this focus?
Note
> >that there can be in this frame controls which act as a container for
other
> >controls, so it could also be one of these. I started with a routine
which
> >enumerates over all controls of the frame container, but this doesn't
find
> >the controls which are again part of a container (ex another frame). Is
> >there an easy method to accomplish this task?

> >Thanks in advance.

> >Peter Notebaert

> >peno1<at>mail<dot>com

> Regards, Frank



Mon, 26 Apr 2004 18:55:20 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. setting focus in the first textbox in a frame

2. Setting focus to another frame keeps returning focus to the calling routine

3. Set focus to first empty critical field

4. Set Focus in text boxes in frames

5. Setting Focus to a Frame

6. Setting the focus to the active application

7. I need an event to occur on a Frame when a contained control receives focus

8. Set focus to a control in an array of controls

9. Active-X-Control Focus Problems

10. Setting first month in a column in MonthView control

11. Any ways to make focus on Label control like focus in button control

12. Set Bound Object Frame Control Source with Function?

 

 
Powered by phpBB® Forum Software