Click here to Skip to main content
16,019,018 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi...
I write the following code for the maximize button because I set the windowstyle trasparent. When I press maximize button if multiple monitors are connected , the application crashes.What is the reason behind it.


C#
IntPtr hwnd = new WindowInteropHelper(this).Handle;
               SetWindowRgn(hwnd, CreateRoundRectRgn(0, 0, (int)SystemParameters.WorkArea.Width, (int)SystemParameters.WorkArea.Height, 0, 0), true);
              this.Height = SystemParameters.WorkArea.Height;
              this.Width = SystemParameters.WorkArea.Width;
              this.Top = SystemParameters.WorkArea.Top;
              this.Left = SystemParameters.WorkArea.Left;
               if (pinFlag==false)
               {
                   LeftPanel.Width = LeftPanel.MinWidth;
               }
               flag = true;
               this.Maindocpanal.Margin = new Thickness(0,0,0,0);
               this.windowborder.CornerRadius = new CornerRadius(0);
               this.windowborder1.CornerRadius = new CornerRadius(0);


Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 13-Aug-11 17:52pm    
Did you try to catch exception and see what is it? Provide full exception dump, indicate lines where it happens.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900