ContainsFocus equivalent in VB

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);
}
}
 
C

Chris

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
 
H

Herfried K. Wagner [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top