|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
currentFocusin an MDI app, how do i determine which MDI child contol currently has the
focus? (from the MDI form) 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. Show quoteHide quote "guy" <g**@discussions.microsoft.com> wrote in message news:7FF938A1-F91C-40BE-AF0A-3DAFD549ECAB@microsoft.com... > in an MDI app, how do i determine which MDI child contol currently has the > focus? (from the MDI form) Or... to answer your question more specifically
Me.ActiveMdiChild.ActiveControl Show quoteHide quote "CMM" <cmm@nospam.com> wrote in message news:e3eUgAlJGHA.1132@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" <g**@discussions.microsoft.com> wrote in message > news:7FF938A1-F91C-40BE-AF0A-3DAFD549ECAB@microsoft.com... >> in an MDI app, how do i determine which MDI child contol currently has >> the >> focus? (from the MDI form) > > 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 Show quoteHide quote "CMM" wrote: > Or... to answer your question more specifically > Me.ActiveMdiChild.ActiveControl > > > "CMM" <cmm@nospam.com> wrote in message > news:e3eUgAlJGHA.1132@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" <g**@discussions.microsoft.com> wrote in message > > news:7FF938A1-F91C-40BE-AF0A-3DAFD549ECAB@microsoft.com... > >> in an MDI app, how do i determine which MDI child contol currently has > >> the > >> focus? (from the MDI form) > > > > > > > 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. Show quoteHide quote "guy" <g**@discussions.microsoft.com> wrote in message news:775C682F-3E97-4659-9E6A-77766F78E02D@microsoft.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" <cmm@nospam.com> wrote in message >> news:e3eUgAlJGHA.1132@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" <g**@discussions.microsoft.com> wrote in message >> > news:7FF938A1-F91C-40BE-AF0A-3DAFD549ECAB@microsoft.com... >> >> in an MDI app, how do i determine which MDI child contol currently has >> >> the >> >> focus? (from the MDI form) >> > >> > >> >> >> thanks for the sarcasm, i spent a lot of time doing just that with no success
Show quoteHide quote "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" <g**@discussions.microsoft.com> wrote in message > news:7FF938A1-F91C-40BE-AF0A-3DAFD549ECAB@microsoft.com... > > in an MDI app, how do i determine which MDI child contol currently has the > > focus? (from the MDI form) > > > 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 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 Show quoteHide quote "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 > > > 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?ID=8ff290d4-5c16-4cef-ba06-56e3599238c1 I hope this helps, Cor thanks cor:)
Show quoteHide quote "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?ID=8ff290d4-5c16-4cef-ba06-56e3599238c1 > > I hope this helps, > > Cor > > >
What am i missing to raise a javascript alert
Application.Exit or End VB2005 pro Graphics Sending a message to another computer -how? Global ImageList Printing at bottom of page Better way to go from ArrayList to Object() XML Comments and ComponentModel.Description attribute Getting an object lost user control |
|||||||||||||||||||||||