|
-
Feb 3rd, 2004, 01:02 AM
#1
Thread Starter
Lively Member
getting the type of the control [Resolved]
halu,
is there any possibility of getting the type of a certain control. let's say a condition of like this...
VB Code:
if control.type = listview then
do this
else if control.type = combobox then
do this
some sort of an algo, i have here. but can this be done in VB.NET? just a newbie asking question... thanx...
Last edited by ayan; Feb 3rd, 2004 at 01:33 AM.
-
Feb 3rd, 2004, 01:07 AM
#2
I'm not sure, but to prevent very large if statements and such, it may be a better idea to create several overloaded functions. Then you can pass whatever you want to it and, as long as you have that as a parameter in 1 of the functions, it'll work.
-
Feb 3rd, 2004, 01:24 AM
#3
Thread Starter
Lively Member
thanx... so there's no thing like a built in functions involving the determination of a control type... i'll just make a function of mine...
thanx man... very much... that's times ten to the power of forever...
--ayan
-
Feb 3rd, 2004, 01:28 AM
#4
Member
Try this.
VB Code:
Dim ctl as control
for each ctl in me.controls
If typeof ctl is Textbox then
'do some crap
else
'do some different crap
end if
next
Last edited by AFterlife; Feb 3rd, 2004 at 01:32 AM.
-
Feb 3rd, 2004, 01:32 AM
#5
Thread Starter
Lively Member
halu,
thanx... that's great.
thanx very much AFterlife... a lot...
i think it's resolved by now.... anywayzzzzzzz, thanx to all of you guys....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|