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

  • Home
  • SEARCH
  • 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 6342889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:19:47+00:00 2026-05-24T20:19:47+00:00

I have a splash screen that i am using it when i am loading

  • 0

I have a splash screen that i am using it when i am loading data from a smart card because it takes about 35 seconds to get the data my loading screen have a white backcolor and i set the TransparencyKey to white color to make the screen transparent.
and it works fine but after about 6 seconds the back color turns to black
Here is the code of the loading screen:

partial class LoadingForm : Form
{
    int tickcount = 0;
    public bool CloseIt = false;
    public string Message = "من فضلك إنتظر قليلا ...";
    public Point LocationPoint;
    public LoadingForm()
    {
        SetStyle(ControlStyles.UserPaint, true);
        SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor | ControlStyles.DoubleBuffer, true);
        InitializeComponent();
        SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor | ControlStyles.DoubleBuffer, true);
        LocationPoint = new Point();
        LocationPoint.X = -300;
        LocationPoint.Y = -300;
        lblMessage.Text = Message;

    }

    private void LoadingForm_Load(object sender, EventArgs e)
    {
        Left = LocationPoint.X;
        Top = LocationPoint.Y;
        timer1.Start();

    }

    private void timer1_Tick(object sender, EventArgs e)
    {
        if (Created)
        {
            if (tickcount++ == 1)
            {
                LocationPoint.X = Screen.PrimaryScreen.Bounds.Width / 2 - 240;
                LocationPoint.Y = Screen.PrimaryScreen.Bounds.Height / 2 - 140;
                lblMessage.Text = Message;

                Left = LocationPoint.X;
                Top = LocationPoint.Y;
                Width = 480;
                Height = 185;
            }
            if (CloseIt)
            {
                pictureBox1.Image = null;
                Close();
                Application.ExitThread();
            }
        }
    }

    private void LoadingForm_FormClosing(object sender, FormClosingEventArgs e)
    {
        timer1.Stop();
        timer1.Dispose();
    }
}

And this is the class that create a thread to run the form on it:

public class LoadingProgress
{
    LoadingForm frm = new LoadingForm();
    string Message = "من فضلك إنتظر قليلا ...";
    Thread th;

    public void StartProgress()
    {
        th = new Thread(new ThreadStart(ShowForm));
        if (frm == null)
            frm = new LoadingForm();
        frm.Message = Message;
        th.Start();
    }

    public void Set_Message(string msg)
    {
        Message = msg;
        frm.Message = Message;
    }

    void ShowForm()
    {
        frm.ShowDialog();

        frm.Dispose();
        frm = null;

        if (th.ThreadState == ThreadState.Running)
            th.Abort();
    }

    public void Stop()
    {
        frm.CloseIt = true;
    }

    public void Set_Position(System.Drawing.Point p)
    {
        frm.LocationPoint = p;
    }
} 
  • 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-24T20:19:48+00:00Added an answer on May 24, 2026 at 8:19 pm

    This is a guess, but I think you’re better off creating all your forms on the main application thread (where the message-pump is), and spin the actual work up on separate threads.

    My guess is that because your form is not handling to windows events (because it’s on the wrong thread), that Windows is essentially marking it as “not responding” and halting any further rendering of it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a label on a splash screen that is displayed for 4 seconds.
I have a task that takes about 10 seconds on the UI thread during
I have a splash screen/loading screen that has .setVisibility() to GONE right after the
I want a splash screen to show while the application is loading. I have
Like many people, I have a splash screen that animates off to reveal the
I used to show a splash screen which in background load some data from
I have a splash screen image that I display with splash.showFullScreen() but it doesn't
I have a question that I have a splash screen in my android app
The eventual aim of this is to have a splash screen in windows that
In a C# windows forms application. I have a splash screen with some multi-threaded

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.