How can I change PictureBox size incrementally and smoothly ? ( in winforms , c# , visual studio 2013 ) -


I have a button whose width is 290 and height 145, which is first hidden. I want to show PictureBox in a while, while the button's mouseent event occurs. So I tried this code:

  Private Zero Button 1_MouseEnter (Object Sender, EventArgs e) {pictureBox1.Size = New Size (0, 145); PictureBox1.Show (); Picturebox for size (int i = 0; i  

But it shows the image box immediately with the primary size.

I found the same question in this site (), but in reality the answer could not help me, too.

Your code performs all at once, so whatever you see will change suddenly .

Use a timer and gradually increase the size when the timer sticks.

  timer = new timer (16); // ~ 60 fps timer. Elapsed + = New ElapsedEventHandler (Timer_Apple); ... Private Zero Button 1_MouseEnter (Object Sender, EventArgs E) {pictureBox1.Size = New Size (0, 145); PictureBox1.Show (); Timer Competent = true; // Enable it} ... Private Zero timer_added (object sender, ElapsedEventArgs E) {if (Picture box 1 width & lt; 290) picture Box1.Width ++; // Increase other timers. Competent = valid; // disable}  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -