Board index » Visual Studio » check type of controls
|
bobz666
|
check type of controls
Visual Studio338
This is a multi-part message in MIME format. ------=_NextPart_000_001C_01C50ACE.68DAAEF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, i'm using code below to check if control is a button how can i check for more types of controls(like checkbox,...) in one 'nice piece" of code I tried to make a select case with 'typeof...is' but i didn't get it = work If Not TypeOf ctr Is Button Then AddHandler ctr.LostFocus, AddressOf meLostFocus AddHandler ctr.GotFocus, AddressOf meGotFocus End If thanx in advance stefan ------=_NextPart_000_001C_01C50ACE.68DAAEF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY> <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV> <DIV><FONT face=3DArial size=3D2>i'm using code below to check if = control is a=20 button</FONT></DIV> <DIV><FONT face=3DArial size=3D2>how can i check for more types of = controls(like=20 checkbox,...)</FONT></DIV> <DIV><FONT face=3DArial size=3D2>in one 'nice piece" of = code</FONT></DIV> <DIV><FONT face=3DArial size=3D2>I tried to make a select case with = 'typeof...is' but i didn't get it work</FONT></DIV> <DIV> </DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>If Not TypeOf ctr Is Button = Then</FONT></DIV> <DIV> <P><FONT face=3DArial size=3D2>AddHandler ctr.LostFocus, AddressOf=20 meLostFocus</FONT></P> <P><FONT face=3DArial size=3D2>AddHandler ctr.GotFocus, AddressOf=20 meGotFocus</FONT></P> <P><FONT face=3DArial size=3D2>End If</FONT></P> <P><FONT face=3DArial size=3D2>thanx in advance</FONT></P> <P><FONT face=3DArial size=3D2>stefan</FONT></P></DIV></BODY></HTML> ------=_NextPart_000_001C_01C50ACE.68DAAEF0-- - |
