473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

check type of controls

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

Nov 21 '05 #1
3 5719
sorry,
answer found
Stefan
"Stefan" <st@nospam.com> schreef in bericht news:Oy*************@tk2msftngp13.phx.gbl...
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

Nov 21 '05 #2
"Stefan" <st@nospam.com> schrieb:
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


\\\
Dim x As Control = ...
Select Case True
Case TypeOf x Is Button, TypeOf x Is ListBox
...
Case Else
...
End Select
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
thanx Herfried
that's what i was looking for
kind regards
Stefan
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schreef in bericht
news:%2****************@TK2MSFTNGP14.phx.gbl...
"Stefan" <st@nospam.com> schrieb:
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


\\\
Dim x As Control = ...
Select Case True
Case TypeOf x Is Button, TypeOf x Is ListBox
...
Case Else
...
End Select
///

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

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rich | last post by:
I have a form with 2 check boxes. One of the check boxes is used to specify that the user is a "primary contact." When I check the primary contact box I want a second box for "standard contact"...
5
by: A.Dagostino | last post by:
hi i need to update an SQL Table when user select or unselect a checkbox control. How Can i do? Thanks Alex
0
by: Robert | last post by:
Stephen, I think I figured out the problem. I was able to get Check Boxes and Option Buttons to work on my form by TURNING OFF RECORD SELECTORS on the form. Not sure why this would make a...
4
by: VR | last post by:
I am trying to embed a check box into a FlexGrid's cell, but having a problem when I start scrolling the grid. Here is my MyCheckBox class... class MyCheckBox : CheckBox { void Init (...
9
by: Alex Shirley | last post by:
Hi there I’m simply trying to check for a blank or empty value in a textbox on my webform. In this instance I do not want to use a requiredfieldvalidator, I want to use a customvalidator (as I...
19
by: Taras_96 | last post by:
Hi everyone, How do you detect that a form element has been changed? This thread: ...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
10
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
6
by: parez | last post by:
Is there anyway i can find out if a control is an input control (textbox,radiobutton,checkbox,dropdown etc) and not a panel,group box etc. I am trying to implement "You have unsaved data on the...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.