ContainsFocus equivalent in VB

  • Thread starter Thread starter Andy G
  • Start date Start date
A

Andy G

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);
}
}
 
Andy said:
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 said:
c.ContainsFocus....I should've looked through intellisense.

Sorry, but I cannot see any difference between 'c.ContainsFocus' in C# and
VB.NET... Note that you are using the same API in both languages.
 
Back
Top