View previous topic :: View next topic |
Author |
Message |
Mart KiXforms Regular


Joined: 03 Oct 2005 Posts: 57 Location: Rotterdam - Netherlands
|
Posted: Wed Sep 17, 2008 8:59 am Post subject: Open form maximized |
|
|
Guy's,
Small question.
Is it possible let a kf.net form open maximized?
I have a workaround like shown below but would like to know if there is anything build into kf.net that enables opening a form maximized.
When a indows is maximize a user is not able to mave the window aroudn and that is eactly what we want, a maximzied windows that cannot be un-maximized (I can just disable to box at the top right corner) and when closed the user gets logged off (I have code for this all ready).
Code: |
Break On
$wmiColl = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_DesktopMonitor")
For Each $wmiObj in $wmiColl
If $wmiObj.DeviceID = "DesktopMonitor1"
$screenwidth = $wmiObj.ScreenWidth
$screenheight = $wmiObj.ScreenHeight
EndIf
Next
$System = CreateObject("Kixforms.System")
If Not $System
$nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf
$nul = $System.Application.EnableVisualStyles
$Form1 = $System.Form()
$Form1.Left = 0
$Form1.StartPosition = 0 ;FormStartPosition_Manual
$Form1.Size = $System.Size($screenwidth,$screenheight) ;(Width,Height)
$Form1.Text = "Form1"
$Form1.Top = 0
$Form1.Show ;Displays the Form
While $Form1.Visible
$Nul = Execute($Form1.DoEvents())
Loop
Exit 0
|
_________________ Mart
- He's chained forever to a world that's departed.....It's not enough, it's not enough - Sorrow by Pink Floyd. |
|
Back to top |
|
 |
Gargoyle KiXforms Aficionado


Joined: 30 Dec 2003 Posts: 366 Location: Arizona
|
Posted: Wed Sep 17, 2008 12:35 pm Post subject: |
|
|
Have you tried
$Form.Height = $Screenheight
$Form.Width = $Screenwidth
Or maybe
$Form.FormWindowState = 2 _________________ Parents were invented to make children happy by giving them something to ignore. |
|
Back to top |
|
 |
Mart KiXforms Regular


Joined: 03 Oct 2005 Posts: 57 Location: Rotterdam - Netherlands
|
Posted: Wed Sep 17, 2008 1:14 pm Post subject: |
|
|
LOL but also
Didn’t even see the WindowState option in kf.net designer. It's there but I just did not look far enough down.
This works just fine.
Code: |
Break On
$System = CreateObject("Kixforms.System")
If Not $System
$nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf
$nul = $System.Application.EnableVisualStyles
$Form1 = $System.Form()
$Form1.MaximizeBox = 0 ;False
$Form1.MinimizeBox = 0 ;False
$Form1.Left = 0
$Form1.StartPosition = 0 ;FormStartPosition_Manual
$Form1.Text = "Form1"
$Form1.Top = 0
$Form1.WindowState = 2 ;FormWindowState_Maximized
$Form1.Show ;Displays the Form
While $Form1.Visible
$Nul = Execute($Form1.DoEvents())
Loop
Exit 0
|
_________________ Mart
- He's chained forever to a world that's departed.....It's not enough, it's not enough - Sorrow by Pink Floyd. |
|
Back to top |
|
 |
|