RadMessageBox and SplashScreen

5 posts, 1 answers
  1. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 01 Aug 2016 Link to this post

    Hi, 

    I'm using RadMessgeBox during the load of my application (SpashScreen).The messages box appears behind the splash.

    Is there a way to show them in topmost ?

    NB : I don't want to use the shown event of the form, cause the messages box are in objects, not directly in the class form.

    thanx :)

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2983 posts

    Posted 01 Aug 2016 Link to this post

    Hi Nermond,

    Thank you for writing. 

    You can subscribe to the Shown event of the message box and make it TopMost:
    private void RadButton1_Click(object sender, EventArgs e)
    {
        RadMessageBox.Instance.Shown += Instance_Shown;
        RadMessageBox.Show(this, "Test");
    }
     
    void Instance_Shown(object sender, EventArgs e)
    {
        RadMessageBoxForm form = sender as RadMessageBoxForm;
        form.TopMost = true;
     
    }

    I hope this will be useful. 

    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 05 Sep 2016 Link to this post

    Thanks for your help :)
  4. Jan
    Jan avatar
    1 posts
    Member since:
    May 2018

    Posted 30 Apr 2020 in reply to Dimitar Link to this post

    Could you add the code for VB to, please?
  5. Nadya
    Admin
    Nadya avatar
    504 posts

    Posted 30 Apr 2020 Link to this post

    Hello Jan,

    Please refer to the code sample in VB:

    Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
            AddHandler RadMessageBox.Instance.Shown, AddressOf Instance_Shown
            RadMessageBox.Show(Me, "Test")
        End Sub
    
        Private Sub Instance_Shown(ByVal sender As Object, ByVal e As EventArgs)
            Dim form As RadMessageBoxForm = TryCast(sender, RadMessageBoxForm)
            form.TopMost = True
        End Sub

    Feel free to use our online converter.

    I hope this information helps. If you need further assistance do not hesitate to contact us.

    Regards,
    Nadya
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top