Problem with showing form...


Author
Message
Ben Hayat
Ben Hayat
Advanced StrataFrame User (548 reputation)Advanced StrataFrame User (548 reputation)Advanced StrataFrame User (548 reputation)Advanced StrataFrame User (548 reputation)Advanced StrataFrame User (548 reputation)Advanced StrataFrame User (548 reputation)Advanced StrataFrame User (548 reputation)Advanced StrataFrame User (548 reputation)Advanced StrataFrame User (548 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
Note: I have tried the same following routine with a regular Windows application and SF Application, and the problem only occurs with SF form. Very simple to duplicate.



a) Create an SF application.

b) Stretch the form bigger than the default.

c) Set the the "WindowState" to Minimize.

d) Drop a "NotifyIcon" component and put the following code for the "Double Click" event:



if (this.WindowState == FormWindowState.Minimized)

{

this.StartPosition = FormStartPosition.CenterScreen;

this.WindowState = FormWindowState.Normal;

this.Activate();

}



When the form shows, the top left conner gets centered, rather than the form itself. Therefore, the form gets pushed to bottom right of the screen.



I did the exact thing with Windows app, and it works right. I think SF creates a collection of forms in the "Program.cs" and when it tries to paint the form, it gets messed up.



Can you advise please?

Thanks!




..ßen
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ben Hayat - 17 Years Ago
Ben Hayat - 17 Years Ago
Greg McGuffey - 17 Years Ago
Ben Hayat - 17 Years Ago
Trent L. Taylor - 17 Years Ago
                         [quote][b]Trent L. Taylor (07/13/2007)[/b][hr]Ben,

This...
Ben Hayat - 17 Years Ago
                             [quote]Why is that?[/quote] The CenterToScreen is a method that...
Trent L. Taylor - 17 Years Ago
                                 [quote]The CenterToScreen is a method that immediately executes the...
Ben Hayat - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search