Can I determine what type of control I've landed on from the control
itself?

e.g. can I have a function like the following?

Private Function GetControlType(ctrl as Control) as String
if ctrl <is a textbox> Then
GetControlType = "TextBox"
ElseIf ctrl <is a checkbox> Then
GetControlType = "CheckBox"
....

End Sub

Is there a property that reliably exists in every control that tells
me its type?

thanks,
gary

Re: Determining control type by Jezebel

Jezebel
Mon Mar 13 15:19:39 CST 2006

If TypeOf ctrl is TextBox then
...




"Gary Hillerson" <garyh@hillysun.net> wrote in message
news:ofbb12l2ebh38g9qo7fk2kn2sql7vijl9d@4ax.com...
> Can I determine what type of control I've landed on from the control
> itself?
>
> e.g. can I have a function like the following?
>
> Private Function GetControlType(ctrl as Control) as String
> if ctrl <is a textbox> Then
> GetControlType = "TextBox"
> ElseIf ctrl <is a checkbox> Then
> GetControlType = "CheckBox"
> ....
>
> End Sub
>
> Is there a property that reliably exists in every control that tells
> me its type?
>
> thanks,
> gary



Re: Determining control type by Gary

Gary
Mon Mar 13 22:13:17 CST 2006

Thanks, Jezebel.

On Tue, 14 Mar 2006 08:19:39 +1100, "Jezebel"
<warcrimes@whitehouse.gov> wrote:

>If TypeOf ctrl is TextBox then
> ...
>
>
>
>
>"Gary Hillerson" <garyh@hillysun.net> wrote in message
>news:ofbb12l2ebh38g9qo7fk2kn2sql7vijl9d@4ax.com...
>> Can I determine what type of control I've landed on from the control
>> itself?
>>
>> e.g. can I have a function like the following?
>>
>> Private Function GetControlType(ctrl as Control) as String
>> if ctrl <is a textbox> Then
>> GetControlType = "TextBox"
>> ElseIf ctrl <is a checkbox> Then
>> GetControlType = "CheckBox"
>> ....
>>
>> End Sub
>>
>> Is there a property that reliably exists in every control that tells
>> me its type?
>>
>> thanks,
>> gary
>