Flyout for winform

2 posts, 0 answers
  1. ardians
    ardians avatar
    1 posts
    Member since:
    Jan 2017

    Posted 30 Apr 2017 Link to this post

    Hi, i'm just tried telerik trial & newbie in telerik winform. I've read and looked up the documentation manual but i dont found flyout.
    i want to question, how to create flyout for winform like my attach files:

    thanks you.

    :)

  2. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 01 May 2017 Link to this post

    Hello,

    Thank you for writing.

    You can achieve the desired result by taking a screenshot of your screen and using it as a background to a form which is shown in a modal window. The SolidBrush class can help you to create the gray overlay. Please check my code snippet below showing how you can handle this scenario on your primary screen: 
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
     
        private void radButton1_Click(object sender, EventArgs e)
        {
            Screen screen = Screen.PrimaryScreen;
            int ix, iy, iw, ih;
            ix = Convert.ToInt32(screen.WorkingArea.X);
            iy = Convert.ToInt32(screen.WorkingArea.Y);
            iw = Convert.ToInt32(screen.WorkingArea.Width);
            ih = Convert.ToInt32(screen.WorkingArea.Height);
            Bitmap image = new Bitmap(iw, ih, PixelFormat.Format32bppArgb);
            Graphics g = Graphics.FromImage(image);
            g.CopyFromScreen(ix, iy, ix, iy,
                 new System.Drawing.Size(iw, ih),
                 CopyPixelOperation.SourceCopy);
     
            Brush b = new SolidBrush(Color.FromArgb(180, 211, 211, 211));
            g.FillRectangle(b, new Rectangle(new Point(0, 0), image.Size));
            b.Dispose();
            g.Dispose();
     
            RadForm1 f = new RadForm1();
            f.ShowInTaskbar = false;
            f.StartPosition = FormStartPosition.Manual;
            f.BackgroundImage = image;
     
            f.FormBorderStyle = FormBorderStyle.None;
            f.Size = image.Size;
            f.Location = new Point(0, 0);
     
            f.ShowDialog();
        }
    }

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top