This is a migrated thread and some comments may be shown as answers.

RadForm and standard form

1 Answer 35 Views
Form
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 19 Sep 2011, 02:46 PM
Hi 

I have an application that has been written over the past 4 years. My company has now purchased RadControls for WinForms and so I am going to slowly convert it screen by screen.

In the meantime though I have a function that is called by all current screens.

SetupScreen(byval frm as form)

I want to do different actions if the form is a Telerik RadForm. How do I know if the frm passed to my function is the standard form or a telerik form? Hopefully without changing the signature of my function "SetupScreen"

Cheers

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 19 Sep 2011, 04:44 PM
Hi Simon,

Thank you for writing and thank you for choosing RadControls for WinForms.

In order to understand whether the passed form is a RadForm descendant or not, check whether the type of the frm variable is RadForm:

Private Sub SetupScreen(ByVal frm As Form)
    If TypeOf frm Is RadForm Then
        'Your new logic
    Else
        'Your existing logic
    End If
End Sub

I hope this helps. Write back if you have additional questions.
Kind regards,
Nikolay
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Form
Asked by
Simon
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or