473,322 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

currentFocus

guy
in an MDI app, how do i determine which MDI child contol currently has the
focus? (from the MDI form)
Jan 31 '06 #1
9 1170
CMM
Um, Me.ActiveMdiChild

? You really should have checked the help files or intellisense before
posting this.

Watch out for ActivateMdiChild (Activate vs Active)... AutoComplete might
have confused you.
"guy" <gu*@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
in an MDI app, how do i determine which MDI child contol currently has the
focus? (from the MDI form)

Jan 31 '06 #2
CMM
Or... to answer your question more specifically
Me.ActiveMdiChild.ActiveControl
"CMM" <cm*@nospam.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
Um, Me.ActiveMdiChild

? You really should have checked the help files or intellisense before
posting this.

Watch out for ActivateMdiChild (Activate vs Active)... AutoComplete might
have confused you.
"guy" <gu*@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
in an MDI app, how do i determine which MDI child contol currently has
the
focus? (from the MDI form)


Jan 31 '06 #3
Guy,

If you do something from a MDI form than it has in my opinion the focus.

If it is from the MDIContainer than it can be something as

\\\
For Each frm As Form In Me.MdiChildren
If frm.Focused Then
MessageBox.Show(frm.Text)
End If
Next
////
This kind of things you can do as well from a MDIChild by adding
\\\
For each frm as Form in Me.MDIParent.MDIChildren
///

I hope this helps

Cor
Jan 31 '06 #4
guy
wrong.
i spent quite a time looking at help, ActiveControl does ***not *** return
the control with the focus. if i have a user control with a number of text
boxes on a form for example it returns the user contriol ***not*** the text
box with focus

"CMM" wrote:
Or... to answer your question more specifically
Me.ActiveMdiChild.ActiveControl
"CMM" <cm*@nospam.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
Um, Me.ActiveMdiChild

? You really should have checked the help files or intellisense before
posting this.

Watch out for ActivateMdiChild (Activate vs Active)... AutoComplete might
have confused you.
"guy" <gu*@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
in an MDI app, how do i determine which MDI child contol currently has
the
focus? (from the MDI form)



Jan 31 '06 #5
guy
hi Cor, yes but which TextBox on frm has the focus? and what if the text box
is on a user control on another user control on the child form?

guy

"Cor Ligthert [MVP]" wrote:
Guy,

If you do something from a MDI form than it has in my opinion the focus.

If it is from the MDIContainer than it can be something as

\\\
For Each frm As Form In Me.MdiChildren
If frm.Focused Then
MessageBox.Show(frm.Text)
End If
Next
////
This kind of things you can do as well from a MDIChild by adding
\\\
For each frm as Form in Me.MDIParent.MDIChildren
///

I hope this helps

Cor

Jan 31 '06 #6
guy
thanks for the sarcasm, i spent a lot of time doing just that with no success

"CMM" wrote:
Um, Me.ActiveMdiChild

? You really should have checked the help files or intellisense before
posting this.

Watch out for ActivateMdiChild (Activate vs Active)... AutoComplete might
have confused you.
"guy" <gu*@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
in an MDI app, how do i determine which MDI child contol currently has the
focus? (from the MDI form)


Jan 31 '06 #7
Guy

I saw that I had still this sample that I once made to show recursive, I
have put it on our website, I thought that it was exactly what you where
asking for.

http://www.vb-tips.com/default.aspx?...6-56e3599238c1

I hope this helps,

Cor
Jan 31 '06 #8
guy
thanks cor:)

"Cor Ligthert [MVP]" wrote:
Guy

I saw that I had still this sample that I once made to show recursive, I
have put it on our website, I thought that it was exactly what you where
asking for.

http://www.vb-tips.com/default.aspx?...6-56e3599238c1

I hope this helps,

Cor

Jan 31 '06 #9
CMM
Ah yes... in which case you need to check the "type" of the active control
and then dive into it to find *its* active control.

For instance there are times if you do MDIParent.ActiveControl you actually
get a reference to one of the MDIChildren.... and you not to code for this
possibility.
"guy" <gu*@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
wrong.
i spent quite a time looking at help, ActiveControl does ***not *** return
the control with the focus. if i have a user control with a number of text
boxes on a form for example it returns the user contriol ***not*** the
text
box with focus

"CMM" wrote:
Or... to answer your question more specifically
Me.ActiveMdiChild.ActiveControl
"CMM" <cm*@nospam.com> wrote in message
news:e3**************@TK2MSFTNGP10.phx.gbl...
> Um, Me.ActiveMdiChild
>
> ? You really should have checked the help files or intellisense before
> posting this.
>
> Watch out for ActivateMdiChild (Activate vs Active)... AutoComplete
> might
> have confused you.
>
>
> "guy" <gu*@discussions.microsoft.com> wrote in message
> news:7F**********************************@microsof t.com...
>> in an MDI app, how do i determine which MDI child contol currently has
>> the
>> focus? (from the MDI form)
>
>


Jan 31 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sacksey | last post by:
Hi. I've been trying to play with this for a while now but I haven't seemed to get it to work. I have a admin controller, which is scaffolded, to input the lat and long along with info. I have a...
0
by: ryt2aamir | last post by:
Hi. I've been trying to play with this for a while now but I haven't seemed to get it to work. I have a admin controller, which is scaffolded, to input the lat and long along with info. I have a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.