views:

145

answers:

1

I would like to disable displaying of the content of the window when resizing, is it possible? The problem is that when I'm resizing my window the controls redraw on correct positions but it doesn't look good because it's not done fluently.

EDIT: I would like a code that would manage the following scenario:

  1. I click on the corner of window
  2. Now only the border of window is visible - the middle part is transparent
  3. I set the size of the window by mouse
  4. I release the mouse button and the middle part of the window will appear

EDIT II:

I've got the MDI application and it doesn't support transparency for child windows

+3  A: 

An idea is to put all the controls in a panel and set it's visibility to false on the resize event of the form.

Edit: this will make the form transparent while resizing.

    private void Form1_ResizeBegin(object sender, EventArgs e)
            {
                panel1.Visible = false;
  Form1.ActiveForm.TransparencyKey = Color.Transparent;
            }
      private void Form1_ResizeEnd(object sender, EventArgs e)
            {
                panel1.Visible = true;
 Form1.ActiveForm.TransparencyKey = Color.Gray; // or whatever color your form was
            }
Iulian
Well, this may lead a user to the conclusion that the window has a bug. Anyway, thank you for a reply!
MartyIX
Edited to make the form transparent while resizing
Iulian
I've got a MDI application and according to this document: http://msdn.microsoft.com/en-us/library/7aw8zc76(VS.80).aspx - the opacity can't be set :-( For SDI it is probably the solution.
MartyIX
I didn't find a way how to do it in MDI. I did a few adjustmenst in resizing events and it looks quite good.
MartyIX