Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1054367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:23:43+00:00 2026-05-16T17:23:43+00:00

Does anybody know a good Modal Window control sort of like the ones used

  • 0

Does anybody know a good Modal Window control sort of like the ones used in Javascript but available for WinForms (C#) with the transparent background and all.

Example in Javascript
http://okonet.ru/projects/modalbox/

Something like

ModalCoolForm f = new ModalCoolForm();
f.ShowDialog(this);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:23:44+00:00Added an answer on May 16, 2026 at 5:23 pm

    Here is a custom Form that’ll do what you want… alter to your taste:

    public partial class ModalLoadingUI : Form
    {
        #region Constants
        private readonly Color BackgroundFadeColor = Color.FromArgb(50, Color.Black);
        #endregion
    
        #region Constructors
        public ModalLoadingUI()
        {
            InitializeComponent();
        }
        #endregion
    
        #region Properties
        /// <summary>
        /// Gets or Sets the main form that will be used as a background canvas for the loading form.
        /// </summary>
        public Form BackgroundForm { get; set; }
    
        /// <summary>
        /// Gets or Sets the text to displayed as the progress text.
        /// </summary>
        public string Title
        { 
            get
            {
                return label1.Text;
            }
    
            set
            {
                label1.Text = value;
            }
        }
    
        /// <summary>
        /// Gets or Sets the value of the progress bar.
        /// </summary>
        public int? Progress
        {
            get
            {
                if (progressBar1.Style == ProgressBarStyle.Marquee)
                {
                    return null;
                }
                else
                {
                    return progressBar1.Value;
                }
            }
    
            set
            {
                if (value == null)
                {
                    progressBar1.Style = ProgressBarStyle.Marquee;
                    progressBar1.Value = 100;
    
                    label2.Visible = false;
                }
                else
                {
                    progressBar1.Style = ProgressBarStyle.Continuous;
                    progressBar1.Value = value.Value;
    
                    label2.Text = string.Format("{0}%", value);
                    label2.Visible = true;
                }
            }
        }
    
        /// <summary>
        /// Gets or Sets a value to indicate if the background form should be faded out.
        /// </summary>
        public bool UseFadedBackground { get; set; }
    
        /// <summary>
        /// Gets or Sets a value to indicate if the splash box is to be displayed.
        /// </summary>
        public bool UseSplashBox
        {
            get
            {
                return picShadow.Visible;
            }
    
            set
            {
                if (value == true)
                {
                    picShadow.Visible = true;
                    panel1.Visible = true;
                }
                else
                {
                    picShadow.Visible = false;
                    panel1.Visible = false;
                }
            }
        }
        #endregion
    
        #region Base Events
        private void ModalLoadingUI_Load(object sender, EventArgs e)
        {
            if (this.BackgroundForm != null)
            {
                this.Location = this.BackgroundForm.Location;
            }
        }
    
        private void ModalLoadingUI_VisibleChanged(object sender, EventArgs e)
        {
            if (this.Visible == true)
            {
                if (this.BackgroundForm != null)
                {
                    this.Location = this.BackgroundForm.Location;
                }
            }
    
            if (System.Diagnostics.Debugger.IsAttached == true)
            {
                this.TopMost = false;
            }
            else
            {
                this.TopMost = true;
            }
        }
    
        private void ModalLoadingUI_Shown(object sender, EventArgs e)
        {
        }
        #endregion
    
        #region Public Methods
        /// <summary>
        /// Paints the background form as the background of this form, if one is defined.
        /// </summary>
        public void CaptureBackgroundForm()
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new MethodInvoker(CaptureBackgroundForm));
                return;
            }
    
            if (this.BackgroundForm == null)
            {
                return;
            }
    
    
            var bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
            Graphics g = Graphics.FromImage(bmpScreenshot);
    
            try
            {
                // COPY BACKGROUND
                int x = this.BackgroundForm.Left;
                int y = this.BackgroundForm.Top;
                var size = this.BackgroundForm.Size;
    
                g.CopyFromScreen(x, y, 0, 0, size, CopyPixelOperation.SourceCopy);
    
                // FADE IF DESIRED
                if (this.UseFadedBackground == true)
                {
                    var rect = new Rectangle(0, 0, size.Width, size.Height);
    
                    g.FillRectangle(new SolidBrush(BackgroundFadeColor), rect);
                }
    
                // PAINT SPLASH BOX SHADOW IF DESIRED
                if(this.UseSplashBox == true)
                {
                    PaintPanelShadow(g);
                }
            }
            catch (Exception e)
            {
                g.Clear(Color.White);
            }
    
            this.BackgroundImage = bmpScreenshot;
        }
    
        /// <summary>
        /// Paints a shadow around the panel, if one is defined.
        /// </summary>
        /// <param name="g">The graphics object to paint into</param>
        private void PaintPanelShadow(Graphics g)
        {
            var shadowImage = picShadow.Image;
    
            var x = panel1.Left + (panel1.Width / 2) - (shadowImage.Width / 2);
            var y = panel1.Top + (panel1.Height / 2) - (shadowImage.Height / 2);
    
            g.DrawImage(shadowImage, x, y, shadowImage.Width, shadowImage.Height);
        }
        #endregion
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.