The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Form Placement
Posted: 19 Oct 09 3:06 PM
|
Any known way to control Where on a user's screen a form pops up? |
|
|
|
Re: Form Placement
Posted: 20 Oct 09 3:47 AM
|
if you are using application.mainviews collection, then you can get an instance of the form, from which you can set top and left properties |
|
|
|
Re: Form Placement
Posted: 20 Oct 09 9:10 AM
|
Top and left in relationship to what, the application?
In other words, are you setting the MainView object's Top and Left? I can add the mainview object with a WindowStyle of 2....which means OnTop of SLX....
and then resizing? |
|
|
|
Re: Form Placement
Posted: 20 Oct 09 9:22 AM
|
try it and find out! the help text says the edge of the container, whatever that means! I would say it will be the screen, as opposed to the application (unless maybe its a modal form?).
let us know the answer though |
|
|
|
Re: Form Placement
Posted: 20 Oct 09 11:02 AM
|
OK setting the MainView left and top sets the ActiveForm left and top....that would be the form that you've placed IN the mainview container. Since I set the form's alignment to alClient that overrides any of that anyway.....
I do have Minimize Maximize and Resize working for an OnTop of SLX window (BorderStyle = 2, WindowStyle = 2).
Also SaveSize and RestoreSize works just fine.
OH, you have to make sure that the form's Close buttons have some kind of modality to them (mine were running scripts that eventually closed the window, but the mainview object overrides that).
Alt-F4 always shuts these windows/containers down....that's the 'X' button\icon in the upper right hand corner of the window.
Thanks for the help John!
Any other ideas: how to place a form/window/mainview object on to a user's computer screen??? Visual Studio and redo the whole thing..... |
|
|
|
Re: Form Placement
Posted: 20 Oct 09 11:28 AM
|
well if I call something like: Dim lReturn Dim objMainView
Set objMainView = Application.MainViews.Add("Personal:frmJustAStandardActiveForm", 0, False) objMainView.Caption = "Active Form Position Test" objMainView.BorderStyle = 2 lReturn = objMainView.Show objMainView.Top = 10 objMainView.Left = 10 Set objMainView = Nothing
then it positions the mainview in the correct place (ie in the top left hand corner of the screen)... |
|
|
|
Re: Form Placement
Posted: 21 Oct 09 9:08 AM
|
John: neither of these work:
objMainView.SaveSize application.Debug.WriteLine "Show Modal " MR = objMainView.ShowModal '''' return of the screen objMainView.Top = 250 objMainView.Left = 100
OR objMainView.Top = 250 objMainView.Left = 100 objMainView.SaveSize application.Debug.WriteLine "Show Modal " MR = objMainView.ShowModal '''' return of the screen
I thought that the physical Show or ShowModal was triggered when the screen was closed by the user....so I don't understand why you would change the top and left of the form AFTER the user has clicked on the close/cancel/OK/X buttons.... |
|
|
|
Re: Form Placement
Posted: 21 Oct 09 9:52 AM
|
ShowModal is the method which displays the screen - and makes it modal. Your code pauses at this point while the screen is active.
After the user finishes with the screen and clicks OK/Cancel, the result is passed to MR (mrOK, mrCancel etc) and your code continues.
You need to set the size and position settings before calling ShowModal. |
|
|
|
Re: Form Placement
Posted: 21 Oct 09 3:12 PM
|
Got it, and that method doesn't work either (I tried both ways).....although John's example seems to support the setting of Left and Top after a .Show.
I think the key here is that a FORM (the Active Form) that sits in a mainview can have left and top positioned IN THE FORM.
This isn't based on which specific monitor that the SLX application is located on.....which is what I'm looking for. |
|
|
|