By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,239 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,239 IT Pros & Developers. It's quick & easy.

ContainsFocus equivalent in VB

P: n/a
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);
}
}

Mar 31 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
Mar 31 '06 #2

P: n/a
c.ContainsFocus....I should've looked through intellisense.

Thanks Chris.

"Chris" <no@spam.com> wrote in message
news:eY**************@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

Mar 31 '06 #3

P: n/a
"Andy G" <ajgould at iastate dot edu> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.