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 6785255
In Process

The Archive Base Latest Questions

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

How to change form with animation(like fading,Cutl Up,…) in win application? I have two

  • 0

How to change form with animation(like fading,Cutl Up,…) in win application?

I have two form Form1,Form2.
I’m in form1 and there is a button on it and i want to change form when button clicked.

//button click
Form2 f2=new Form2();
this.hide();
f2.show();
  • 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-26T17:06:17+00:00Added an answer on May 26, 2026 at 5:06 pm

    You can use AnimateWindow(), define a new form class and override OnLoad() to show the form with your desired effects.

    // Console Application
    // Load System.Windows.Forms reference.
    
    [System.Runtime.InteropServices.DllImport("user32.dll")]
    public static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);
    
    class SlidingForm: System.Windows.Forms.Form 
    {
        const int AW_ACTIVATE = 0X20000;
        const int AW_SLIDE = 0X40000;
        const int AW_HOR_POSITIVE = 0X1;
    
        protected override void OnLoad(System.EventArgs e)
        {
            AnimateWindow(this.Handle, 1000, AW_ACTIVATE | AW_SLIDE | AW_HOR_POSITIVE);
            base.OnLoad(e);
        }
    }
    
    void Main()
    {
        var frm = new SlidingForm().ShowDialog;
    }
    

    Sample code to hide a PictureBox control as requested:

    private void button1_Click(object sender, EventArgs e)
    {
       const int AW_HIDE = 0x00010000;
       const int AW_SLIDE = 0x00040000;
       const int AW_HOR_NEGATIVE = 0x00000002;
       const int AW_HOR_POSITIVE = 0x00000001;
       // Toggle show/hide
       AnimateWindow(pictureBox1.Handle, 1000, (pictureBox1.Visible) ? (AW_HIDE | AW_HOR_NEGATIVE) : (AW_HOR_POSITIVE) | AW_SLIDE);
       pictureBox1.Visible ^= true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For simplicity lets say I have two flex mxml pages. form.mxml button.mxml If the
I would like to make an entire inline formset within an admin change form
There is a plugin for moootols that applied to a form change it into
I have a function that adds change events for form items based on the
Post-release, I have made one small change to one form in our development site
change() function works and detects changes on form elements, but is there a way
I have a standard admin change form for an object, with the usual StackedInline
I want to have the background image change form one to another and fade
I have the following form for my users to change their email addresses. <form
I have an animation in WPF that is jerky, my WPF form is layed

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.