|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ContainsFocus equivalent in VBIn the below snippet of code how can I write the line, else if
(c.ContainsFocus) in vb? Thanks. foreach (Control c in controls) { if (c.Focused) { // Return the focused control return c; } else if (c.ContainsFocus) { // If the focus is contained inside a control's children // return the child return getFocused(c.Controls); } } Andy G wrote:
Show quoteHide quote > In the below snippet of code how can I write the line, else if for each c as Control in me.controls> (c.ContainsFocus) in vb? Thanks. > > > foreach (Control c in controls) > { > if (c.Focused) > { > // Return the focused control > return c; > } > else if (c.ContainsFocus) > { > // If the focus is contained inside a control's children > // return the child > return getFocused(c.Controls); > } > } > > > if c.Focused then 'Return the focused control return c elseif c.ContainsFocus then 'If the focus is contained inside a control's children 'return the child return getFocused(c.Controls) end if next c.ContainsFocus....I should've looked through intellisense.
Thanks Chris. Show quoteHide quote "Chris" <no@spam.com> wrote in message news:eY51d5OVGHA.4884@TK2MSFTNGP10.phx.gbl... > Andy G wrote: >> In the below snippet of code how can I write the line, else if >> (c.ContainsFocus) in vb? Thanks. >> >> >> foreach (Control c in controls) >> { >> if (c.Focused) >> { >> // Return the focused control >> return c; >> } >> else if (c.ContainsFocus) >> { >> // If the focus is contained inside a control's children >> // return the child >> return getFocused(c.Controls); >> } >> } >> >> >> > > > for each c as Control in me.controls > > if c.Focused then > > 'Return the focused control > return c > > elseif c.ContainsFocus then > > 'If the focus is contained inside a control's children > 'return the child > return getFocused(c.Controls) > end if > next "Andy G" <ajgould at iastate dot edu> schrieb: Sorry, but I cannot see any difference between 'c.ContainsFocus' in C# and > c.ContainsFocus....I should've looked through intellisense. VB.NET... Note that you are using the same API in both languages. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Get the selected value from a listbox
Help Needed WIth Printing BN.NET 2005 dll not reading .config ? Importing from Excel Passing a Variable from one web site to another for ASP Passing Vb equivilent of "structs" between forms settings.settings ?? Use active directory to scan for software on a remote system? Reading an argument given to the program when started Q: DatePicker |
|||||||||||||||||||||||