KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Disable resizeing a form

 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
Mart
KiXforms Regular
KiXforms Regular


Joined: 03 Oct 2005
Posts: 57
Location: Rotterdam - Netherlands

PostPosted: Thu Jan 17, 2008 10:34 am    Post subject: Disable resizeing a form Reply with quote

Guy's,

I'm having a problem with resizing a form. I need the form to be a specific size and therefore I want to disable resizing the form.

I know there are the MaximumSize and MinimumSize properties but they don't seem to work. Maybe I'm doing something wrong but the form can still be resized by puling the right bottom corner when I put in these two properties.

I'm using kf.net version 3.1.46.0.

Code snippet:
Code:

....

$Form1 = $System.Form()
$Form1.MaximizeBox = 0  ;False
$Form1.MinimumSize = 616,605
$Form1.MaximumSize = 616,605
$Form1.StartPosition = 1  ;FormStartPosition Centerscreen
$Form1.Size = $System.Size(616,605) ;(Width,Height)
$Form1.Text = "Some text"

....

_________________
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
View user's profile Send private message
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Thu Jan 17, 2008 12:59 pm    Post subject: Reply with quote

Hi Mart,
I think the property you are looking for is .FormBorderStyle, you have a few options; here is an example:

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.FormBorderStyle = $System.FormBorderStyle_Fixed3D
;$Form1.FormBorderStyle = $System.FormBorderStyle_FixedDialog
$Form1.FormBorderStyle = $System.FormBorderStyle_FixedSingle
;$Form1.FormBorderStyle = $System.FormBorderStyle_FixedToolWindow
;$Form1.FormBorderStyle = $System.FormBorderStyle_None
;$Form1.FormBorderStyle = $System.FormBorderStyle_Sizable ;default
;$Form1.FormBorderStyle = $System.FormBorderStyle_SizableToolWindow

$Form1.StartPosition = 1  ;FormStartPosition_CenterScreen
$Form1.Size = $System.Size(398,298) ;(Width,Height)
$Form1.Text = "Form"

$Form1.Show  ;Displays the Form

While $Form1.Visible
   $Nul = Execute($Form1.DoEvents())
Loop
Exit 0

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
Mart
KiXforms Regular
KiXforms Regular


Joined: 03 Oct 2005
Posts: 57
Location: Rotterdam - Netherlands

PostPosted: Thu Jan 17, 2008 4:13 pm    Post subject: Reply with quote

Benny,

You are the man! Works like a charm.
May I ask what the MinimunSize and MaximunSize properties are for? My first thought was to disable resizing with them because you specify an max and min size that are the same as the form size.

_________________
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
View user's profile Send private message
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Thu Jan 17, 2008 9:21 pm    Post subject: Reply with quote

your thinking is correct, the way to use those properties is like this:

Code:

$Form1 = $System.Form()
$Form1.MaximizeBox = 0  ;False
$Form1.MinimumSize = $System.Size(616,605) ;(Width,Height)
$Form1.StartPosition = 1  ;FormStartPosition Centerscreen
$Form1.Size = $System.Size(616,605) ;(Width,Height)
$Form1.Text = "Some text"


you would only use one and not the other, the idea behind these properties is that you want the user to be able to make the form smaller or larger but not both on the same form. in other words you might want the user to be able to make the form smaller but not larger, or you may want the user to beable to make the form larger but not smaller. so you would only use one of those properties and not the other. if you don't want the user to be able to resize the form at all then you want to use the .FormBorderStyle property.

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
Mart
KiXforms Regular
KiXforms Regular


Joined: 03 Oct 2005
Posts: 57
Location: Rotterdam - Netherlands

PostPosted: Thu Jan 17, 2008 9:30 pm    Post subject: Reply with quote

Allrightie then. Learned something today.
Thanks.

_________________
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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group