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

How to detect if form minimised/restored event ?

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


Joined: 12 Oct 2004
Posts: 130
Location: Manchester UK

PostPosted: Thu Jul 19, 2007 9:34 pm    Post subject: How to detect if form minimised/restored event ? Reply with quote

I need to detect via an event whether a form has been minimised or restored to original, and for future I suppose maximised, so I can take apropriate actions. Not having a lot of luck in the help file or by a search.
Anyone know the information / can point me to it to help me on my way ?

Smile
________
Echo


Last edited by MACE1 on Fri Feb 18, 2011 5:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Jul 19, 2007 10:00 pm    Post subject: Reply with quote

Hi Mace,

One can use the Form.SizeChanged event and Form.WindowState property to make these determinations, here's some sample code:

Set the form to maximized, minimized and normal and watch the text in the titlebar change ...

Code:

Break On

$System = CreateObject("Kixforms.System")

$Form = $System.Form()
$Form.SizeChanged = "Form_SizeChanged()"

$Form.Center
$Form.Show
$Form.Text = "Normal"

While $Form.Visible
 $= Execute($Form.DoEvents)
Loop

Exit 0

Function Form_SizeChanged()

 Select
  Case $Form.WindowState = $System.FormWindowState_Maximized
   $Form.Text = "Maximized"
  Case $Form.WindowState = $System.FormWindowState_Minimized
   $Form.Text = "Minimized"
  Case $Form.WindowState = $System.FormWindowState_Normal
   $Form.Text = "Normal"
 EndSelect

EndFunction
Back to top
View user's profile Send private message
MACE1
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 12 Oct 2004
Posts: 130
Location: Manchester UK

PostPosted: Fri Jul 20, 2007 8:06 am    Post subject: Reply with quote

Very Happy
As always you are a STAR !
________
Drug test
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