locked
Animated Controls RRS feed

  • Question

  • Hello, I have been locking for a demo or something similar to implement "animated controls" (or panels) on a windows form,

    It is to say, I would like to have a panel A full buttons, and then click a (button outside the panel A) and switch (slide) with animation to another panel B full of other buttons. I know that I could work with a Timer and the panel location inside the form, but if I do that, the panels needs to be "redrawn" while it moves over the form and it looks not nice (lines appear and disappear), If I could just take kind a "screen shot" of panel A and B, so that, I could use them as a background image and implement frames with a timer ... It is only a guess,

    Does someone have any suggestions, or has someone seen some kind of similar implementation around there?
    Is there any way to take a "screen shot" of a panel or windows form in general?

    Thanks you very much,
    kikeman.

    • Moved by OmegaMan Monday, June 15, 2009 7:37 PM (From:Visual C# General)
    Monday, June 15, 2009 4:06 PM

Answers

  • Doing what you want to do in WinForms is a lot like trying to turn a Yugo into a dragster, without replacing any of the parts. Sure, it can be done, but it'll be a bizarre mess.

    If you're interested in seeing what WPF can do (and do quickly), go here:
    http://www.microsoft.com/expression/products/Overview.aspx?key=blend

    The XAML editor in Visual Studio is lame. With Expression Blend and a few tutorials (found on that web site) you can be making very cool animated apps in just minutes. In fact, I guarentee that if you download Blend and do one or two of the animation tutorials, you'll look at WinForms as if it suddenly turned into a gelatinous pile of.. well.. use your imagination.
    • Marked as answer by Kikeman Tuesday, June 16, 2009 2:59 PM
    Tuesday, June 16, 2009 12:07 AM

All replies

  • Can you use WPF? that comes with all the animation and storyboard stuff build in.

    • Proposed as answer by David M Morton Monday, June 15, 2009 4:33 PM
    • Unproposed as answer by Kikeman Monday, June 15, 2009 4:33 PM
    Monday, June 15, 2009 4:32 PM
  • No my friend, I already have a big part of my project done and I would need to invest time learning/converting WPF, I undestand it is the newest desing way of doing things but I need to survive at the moment with "classic form design"

    Thanks anyway,
    Enrique.
    Monday, June 15, 2009 4:36 PM
  • Its not exactly the newest thing around its almost 3 years sine official release and almost 5 since the fist beta's. But since you want to stick with classic winforms no reason it can't look nice, you can use the DrawToBitmap function avaiable on all controls to render the control to a bitmap however there is a big sidenote here the control *HAS* to be visible before this function will give you proper results. somehow the icons to embed a link are missing but here's the msdn page on that function http://msdn.microsoft.com/en-us/library/system.windows.forms.control.drawtobitmap.aspx
    Monday, June 15, 2009 4:48 PM

  • so, I guess WPF can be used only from VS ver.9. (VS_2008?), correct? Is there any good tutorial of WPF only to check it out.

    Thanks,
    kikeman.

    Monday, June 15, 2009 7:26 PM
  • This might do a screenshot.  Untested.

    Surface backbuffer = m_graphics.Device.GetBackBuffer(0, 0, BackBufferType.Mono);

    SurfaceLoader.Save(@"c:\Screenshot.jpg", ImageFileFormat.Jpg, backbuffer);

    backbuffer.Dispose();


    http://msdn.microsoft.com/en-us/library/bb324059(VS.85).aspx

    Most of the stuff in the library on this subject is missing, is corupt, has a bad link, or is otherwise no longer available.


    Mark the best replies as answers. "Fooling computers since 1971."
    Monday, June 15, 2009 7:58 PM
  • Doing what you want to do in WinForms is a lot like trying to turn a Yugo into a dragster, without replacing any of the parts. Sure, it can be done, but it'll be a bizarre mess.

    If you're interested in seeing what WPF can do (and do quickly), go here:
    http://www.microsoft.com/expression/products/Overview.aspx?key=blend

    The XAML editor in Visual Studio is lame. With Expression Blend and a few tutorials (found on that web site) you can be making very cool animated apps in just minutes. In fact, I guarentee that if you download Blend and do one or two of the animation tutorials, you'll look at WinForms as if it suddenly turned into a gelatinous pile of.. well.. use your imagination.
    • Marked as answer by Kikeman Tuesday, June 16, 2009 2:59 PM
    Tuesday, June 16, 2009 12:07 AM