RadForm and standard form

2 posts, 0 answers
  1. Simon
    Simon avatar
    7 posts
    Member since:
    Sep 2011

    Posted 19 Sep 2011 Link to this post


    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"


  2. Nikolay
    Nikolay avatar
    1805 posts

    Posted 19 Sep 2011 Link to this post

    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
            'Your existing logic
        End If
    End Sub

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

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

Back to Top