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

Progressbar - gaps in display

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


Joined: 10 Aug 2005
Posts: 50

PostPosted: Sat Nov 05, 2005 1:33 pm    Post subject: Progressbar - gaps in display Reply with quote

Hi,

I have just implimented a progressbar and have noticed that sometimes small (aprox 2 pixel) gaps appear. Is this likely to be a fault of my code or the alpha state of the progressbar control?


Code:
$ProgressBar = $System.ProgressBar()
$ProgressBar.Left = 5
$ProgressBar.Text = ""
$ProgressBar.Top = 615
$ProgressBar.Width = 611
$ProgressBar.Click = "quit"
$nul = $Form.Controls.Add($ProgressBar)

~~~~~~~
$ProgressStep = Round(100 /$LB1.SelectedItems.Count ,0)
$ProgressBar.Value = 0

For Each ~~~~~

$ProgressBar.Value = $ProgressBar.Value + $ProgressStep

Next

$ProgressBar.Value = 0
[/code]
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: Sat Nov 05, 2005 4:09 pm    Post subject: Reply with quote

could you post your entire code so that we can better examine what is going on?
_________________
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
mercury
KiXforms Regular
KiXforms Regular


Joined: 10 Aug 2005
Posts: 50

PostPosted: Sat Nov 05, 2005 8:15 pm    Post subject: Reply with quote

Ok, first the disclaimer Smile

This is a work in progress that is largely incomplete and will be refined as I learn better ways to do things. In fact this project is in part an excuse to learn KiXtart and explore KiXforms.net.

This is yet another front-end for Active Directory tailored to allow Teachers to administer pupil accounts with out having to understand the AD infrastructure. Things like home paths, security groups, OUs etc are handled automatically and make the chore of moving accounts at the end of the year fast and intuitive. - That's the intent Wink

Right now the code isn't very portable and expects a specific AD design.
The AD structure is:

I've indicated OUs and Security Group with parentheses


Pupils(OU)
> Years 1-4(OU) ; Child to Pupils OU
> Years 5-6(OU) ; "
> Years 7-9(OU) ; "
> Years 10-11(OU) ; "

Domain Groups(OU)
> Years(OU) ; Child to Domain Groups OU
>> Year 01(Group)
>> Year 02(Group)
>> :
>> :
>> :
>> Year 10(Group)
>> Year 11(Group)
>>> Classes(OU) ; Child to Years OU
>>> Year 01 XX(Group)
>>> Year 02 XX(Group)
>>> :
>>> :
>>> :
>>> Year 10 XX(Group)
>>> Year 11 XX(Group)


The section of code that relates to the issue at hand is UDF_MoveAccounts.


Code:
; ==========================================================
;   Title: Delegate Administrator

;   Author: Ken Hamilton
;   Version: 1.0
;   Build Date: 5th November 2005

;   Language: KiXtart 2010 (Version4.5.1)
;               & KiXForms.NET (Version 3.1.22.0)
; ==========================================================
;   Description:
   
;   Customised Console to allow delegated administrators
;   limited access to Active Directory support functions.
; ==========================================================

Break On

$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf

;#######
:Form
;#######

$FormDelegateAdministrator = $System.Form()
$FormDelegateAdministrator.AutoScroll = -1  ;True
$FormDelegateAdministrator.Left = 0
$FormDelegateAdministrator.StartPosition = 0  ;FormStartPosition_Manual
$FormDelegateAdministrator.Size = $System.Size(710,668) ;(Width,Height)
$FormDelegateAdministrator.Text = "Delagate Administrator"
$FormDelegateAdministrator.Top = 0

$TabControlDelegateAdministrator = $System.TabControl()
$TabControlDelegateAdministrator.Height = 610
$TabControlDelegateAdministrator.Left = 0
$TabControlDelegateAdministrator.Top = 0
$TabControlDelegateAdministrator.Width = 700
$nul = $FormDelegateAdministrator.Controls.Add($TabControlDelegateAdministrator)

$TabControlDelegateAdministratorTabPageGeneral = $System.TabPage()
$TabControlDelegateAdministratorTabPageGeneral.Text = "General"
$nul = $TabControlDelegateAdministrator.Controls.Add($TabControlDelegateAdministratorTabPageGeneral)

$TabControlDelegateAdministratorTabPageNewAccs = $System.TabPage()
$TabControlDelegateAdministratorTabPageNewAccs.Text = "New Account/s"
$nul = $TabControlDelegateAdministrator.Controls.Add($TabControlDelegateAdministratorTabPageNewAccs)

$TabControlDelegateAdministratorTabPageCLAIT = $System.TabPage()
$TabControlDelegateAdministratorTabPageCLAIT.Text = "CLAIT Administrator"
$nul = $TabControlDelegateAdministrator.Controls.Add($TabControlDelegateAdministratorTabPageCLAIT)

$TabControlDelegateAdministratorTabPageAbout = $System.TabPage()
$TabControlDelegateAdministratorTabPageAbout.Text = "About"
$nul = $TabControlDelegateAdministrator.Controls.Add($TabControlDelegateAdministratorTabPageAbout)

;###########
:TABGeneral
;###########

;-------------
:GroupClasses
;-------------

$GroupBoxClasses = $System.GroupBox()
$GroupBoxClasses.Height = 570
$GroupBoxClasses.Left = 2
$GroupBoxClasses.Text = "Select - Move Accounts"
$GroupBoxClasses.Top = 10
$GroupBoxClasses.Width = 425
$nul = $TabControlDelegateAdministratorTabPageGeneral.Controls.Add($GroupBoxClasses)

$ComboBoxClass1 = $System.ComboBox()
$ComboBoxClass1.DropDownWidth = 160
$ComboBoxClass1.Height = 21
$ComboBoxClass1.ItemHeight = 13
$ComboBoxClass1.Left = 10
$ComboBoxClass1.Text = "Select Class 1 ..."
$ComboBoxClass1.Top = 20
$ComboBoxClass1.Width = 160
$ComboBoxClass1.SelectedIndexChanged = "UDF_ListUsers(Class1)"
$nul = $GroupBoxClasses.Controls.Add($ComboBoxClass1)

$ListBoxClass1 = $System.ListBox()
$ListBoxClass1.Height = 485
$ListBoxClass1.Left = 10
$ListBoxClass1.SelectionMode = 3  ;MultiExtended
$ListBoxClass1.Top = 50
$ListBoxClass1.Width = 160
$ListBoxClass1.Sorted = -1
$ListBoxClass1.Click = "UDF_ShowUserDetails(Class1)"
$nul = $GroupBoxClasses.Controls.Add($ListBoxClass1)

$ButtonClass1SelectAll = $System.Button()
$ButtonClass1SelectAll.Left = 10
$ButtonClass1SelectAll.Text = "Select All/None"
$ButtonClass1SelectAll.Top = 540
$ButtonClass1SelectAll.Width = 160
$ButtonClass1SelectAll.Click = "UDF_Class1SelectAll()"
$nul = $GroupBoxClasses.Controls.Add($ButtonClass1SelectAll)

$ButtonClass1toClass2 = $System.Button()
$ButtonClass1toClass2.Height = 25
$ButtonClass1toClass2.Left = 176
$ButtonClass1toClass2.Text = "->"
$ButtonClass1toClass2.Top = 205
$ButtonClass1toClass2.Width =75
$ButtonClass1toClass2.Click = "UDF_MoveAccounts(Class1toClass2)"
$nul = $GroupBoxClasses.Controls.Add($ButtonClass1toClass2)

$ButtonClass2toClass1 = $System.Button()
$ButtonClass2toClass1.Height = 25
$ButtonClass2toClass1.Left = 176
$ButtonClass2toClass1.Text = "<-"
$ButtonClass2toClass1.Top = 280
$ButtonClass2toClass1.Width = 75
$ButtonClass2toClass1.Click = "UDF_MoveAccounts(Class2toClass1)"
$nul = $GroupBoxClasses.Controls.Add($ButtonClass2toClass1)

$ButtonUndoMoveUsers = $System.Button()
$ButtonUndoMoveUsers.Left = 176
$ButtonUndoMoveUsers.Text = "Undo Move"
$ButtonUndoMoveUsers.Top = 400
$ButtonUndoMoveUsers.Width = 75
$ButtonUndoMoveUsers.Height = 25
$ButtonUndoMoveUsers.Click = "UDF_UndoMove()"
$nul = $GroupBoxClasses.Controls.Add($ButtonUndoMoveUsers)

$ComboBoxClass2 = $System.ComboBox()
$ComboBoxClass2.DropDownWidth = 160
$ComboBoxClass2.Height = 21
$ComboBoxClass2.ItemHeight = 13
$ComboBoxClass2.Left = 255
$ComboBoxClass2.Text = "Select Class 2 ..."
$ComboBoxClass2.Top = 20
$ComboBoxClass2.Width = 160
$ComboBoxClass2.SelectedIndexChanged = "UDF_ListUsers(Class2)"
$nul = $GroupBoxClasses.Controls.Add($ComboBoxClass2)

$ListBoxClass2 = $System.ListBox()
$ListBoxClass2.Height = 485
$ListBoxClass2.Left = 255
$ListBoxClass2.SelectionMode = 3  ;MultiExtended
$ListBoxClass2.Top = 50
$ListBoxClass2.Width = 160
$ListBoxClass2.Sorted = -1
$ListBoxClass2.Click = "UDF_ShowUserDetails(Class2)"
$nul = $GroupBoxClasses.Controls.Add($ListBoxClass2)

$ButtonClass2SelectAll = $System.Button()
$ButtonClass2SelectAll.Left = 255
$ButtonClass2SelectAll.Text = "Select All/None"
$ButtonClass2SelectAll.Top = 540
$ButtonClass2SelectAll.Width = 160
$ButtonClass2SelectAll.Click = "UDF_Class2SelectAll()"
$nul = $GroupBoxClasses.Controls.Add($ButtonClass2SelectAll)

;--------------------
:GroupAccountDetails
;--------------------

$GroupBoxAccountDetails = $System.GroupBox()
$GroupBoxAccountDetails.Height = 425
$GroupBoxAccountDetails.Left = 433
$GroupBoxAccountDetails.Text = "Account Details"
$GroupBoxAccountDetails.Top = 10
$GroupBoxAccountDetails.Width = 255
$nul = $TabControlDelegateAdministratorTabPageGeneral.Controls.Add($GroupBoxAccountDetails)

$CheckBoxAccModify = $System.CheckBox()
$CheckBoxAccModify.Left = 5
$CheckBoxAccModify.Text = "Modify"
$CheckBoxAccModify.Top = 15
$CheckBoxAccModify.Height = 19
$CheckBoxAccModify.Width = 114
$CheckBoxAccModify.CheckChanged = "UDF_EnableAccDetailsModify()"
$nul = $GroupBoxAccountDetails.Controls.Add($CheckBoxAccModify)

$LabelsAMAccountName = $System.Label()
$LabelsAMAccountName.Left = 5
$LabelsAMAccountName.Text = "User Name"
$LabelsAMAccountName.TextAlign = 16  ;MiddleLeft
$LabelsAMAccountName.Top = 35
$LabelsAMAccountName.Width = 65
$LabelsAMAccountName.Height = 20
$nul = $GroupBoxAccountDetails.Controls.Add($LabelsAMAccountName)

$TextBoxsAMAccountName = $System.TextBox()
$TextBoxsAMAccountName.BackColor = $System.Color.FromName("InactiveBorder")
$TextBoxsAMAccountName.BorderStyle = 1 ;FixedSingle
$TextBoxsAMAccountName.Enabled = 0  ;False
$TextBoxsAMAccountName.Left = 75
$TextBoxsAMAccountName.Text = ""
$TextBoxsAMAccountName.Top = 35
$TextBoxsAMAccountName.Width = 175
$nul = $GroupBoxAccountDetails.Controls.Add($TextBoxsAMAccountName)

$LabelFirstName = $System.Label()
$LabelFirstName.Left = 5
$LabelFirstName.Text = "First Name"
$LabelFirstName.TextAlign = 16  ;MiddleLeft
$LabelFirstName.Top = 60
$LabelFirstName.Width = 65
$LabelFirstName.Height = 20
$nul = $GroupBoxAccountDetails.Controls.Add($LabelFirstName)

$TextBoxFirstName = $System.TextBox()
$TextBoxFirstName.Enabled = 0  ;False
$TextBoxFirstName.Left = 5
$TextBoxFirstName.Text = ""
$TextBoxFirstName.Top = 80
$TextBoxFirstName.Width = 105
$nul = $GroupBoxAccountDetails.Controls.Add($TextBoxFirstName)

$LabelLastName = $System.Label()
$LabelLastName.Left = 145
$LabelLastName.Text = "Last Name"
$LabelLastName.TextAlign = 16  ;MiddleLeft
$LabelLastName.Top = 60
$LabelLastName.Width = 65
$LabelLastName.Height = 20
$nul = $GroupBoxAccountDetails.Controls.Add($LabelLastName)

$TextBoxLastName = $System.TextBox()
$TextBoxLastName.Enabled = 0  ;False
$TextBoxLastName.Left = 145
$TextBoxLastName.Text = ""
$TextBoxLastName.Top = 80
$TextBoxLastName.Width = 105
$nul = $GroupBoxAccountDetails.Controls.Add($TextBoxLastName)

$CheckBoxAccLocked = $System.CheckBox()
$CheckBoxAccLocked.Enabled = 0  ;False
$CheckBoxAccLocked.Left = 5
$CheckBoxAccLocked.Text = "Account Is Locked"
$CheckBoxAccLocked.Top = 105
$CheckBoxAccLocked.Width = 120
$nul = $GroupBoxAccountDetails.Controls.Add($CheckBoxAccLocked)

$CheckBoxAccDisabled = $System.CheckBox()
$CheckBoxAccDisabled.Enabled = 0  ;False
$CheckBoxAccDisabled.Left = 5
$CheckBoxAccDisabled.Text = "Account Is Disabled"
$CheckBoxAccDisabled.Top = 130
$CheckBoxAccDisabled.Width = 130
$nul = $GroupBoxAccountDetails.Controls.Add($CheckBoxAccDisabled)

$CheckBoxNeverExpiresPW = $System.CheckBox()
$CheckBoxNeverExpiresPW.Enabled = 0  ;False
$CheckBoxNeverExpiresPW.Left = 5
$CheckBoxNeverExpiresPW.Text = "Password Never Expires"
$CheckBoxNeverExpiresPW.Top = 155
$CheckBoxNeverExpiresPW.Width = 150
$nul = $GroupBoxAccountDetails.Controls.Add($CheckBoxNeverExpiresPW)

$CheckBoxCannotChangePW = $System.CheckBox()
$CheckBoxCannotChangePW.Enabled = 0  ;False
$CheckBoxCannotChangePW.Left = 5
$CheckBoxCannotChangePW.Text = "User Cannot Change Password"
$CheckBoxCannotChangePW.Top = 180
$CheckBoxCannotChangePW.Width = 182
$nul = $GroupBoxAccountDetails.Controls.Add($CheckBoxCannotChangePW)

$LabelGroupMembership = $System.Label()
$LabelGroupMembership.Left = 5
$LabelGroupMembership.Text = "Group Membership"
$LabelGroupMembership.TextAlign = 16  ;MiddleLeft
$LabelGroupMembership.Top = 205
$LabelGroupMembership.Width = 115
$nul = $GroupBoxAccountDetails.Controls.Add($LabelGroupMembership)

$ListBoxGroupMembership = $System.ListBox()
$ListBoxGroupMembership.BackColor = $System.Color.FromName("InactiveBorder")
$ListBoxGroupMembership.Enabled = 0  ;False
$ListBoxGroupMembership.Height = 101
$ListBoxGroupMembership.Left = 5
$ListBoxGroupMembership.SelectionMode = 3  ;MultiExtended
$ListBoxGroupMembership.Top = 230
$ListBoxGroupMembership.Width = 105
$nul = $GroupBoxAccountDetails.Controls.Add($ListBoxGroupMembership)

$ButtonGroupMembershipSelectAll = $System.Button()
$ButtonGroupMembershipSelectAll.Height = 20
$ButtonGroupMembershipSelectAll.Left = 5
$ButtonGroupMembershipSelectAll.Text = "Select All/None"
$ButtonGroupMembershipSelectAll.Top = 332
$ButtonGroupMembershipSelectAll.Width = 105
$ButtonGroupMembershipSelectAll.Enabled = 0 ;False
$ButtonGroupMembershipSelectAll.Click = "UDF_GroupMembershipSelectAll()"
$nul = $GroupBoxAccountDetails.Controls.Add($ButtonGroupMembershipSelectAll)

$ButtonRemoveFromGroup = $System.Button()
$ButtonRemoveFromGroup.Height = 20
$ButtonRemoveFromGroup.Left = 115
$ButtonRemoveFromGroup.Text = "->"
$ButtonRemoveFromGroup.Top = 265
$ButtonRemoveFromGroup.Width = 25
$ButtonRemoveFromGroup.Enabled = 0 ;False
$ButtonRemoveFromGroup.Click = "UDF_RemoveFromGroup()"
$nul = $GroupBoxAccountDetails.Controls.Add($ButtonRemoveFromGroup)

$ButtonAddToGroup = $System.Button()
$ButtonAddToGroup.Height = 20
$ButtonAddToGroup.Left = 115
$ButtonAddToGroup.Text = "<-"
$ButtonAddToGroup.Top = 300
$ButtonAddToGroup.Width = 25
$ButtonAddToGroup.Enabled = 0 ;False
$ButtonAddToGroup.Click = "UDF_AddToGroup()"
$nul = $GroupBoxAccountDetails.Controls.Add($ButtonAddToGroup)

$LabelAvailableGroups = $System.Label()
$LabelAvailableGroups.Left = 150
$LabelAvailableGroups.Text = "Available Groups"
$LabelAvailableGroups.TextAlign = 16  ;MiddleLeft
$LabelAvailableGroups.Top = 205
$nul = $GroupBoxAccountDetails.Controls.Add($LabelAvailableGroups)

$ListBoxAvailableGroups = $System.ListBox()
$ListBoxAvailableGroups.BackColor = $System.Color.FromName("InactiveBorder")
$ListBoxAvailableGroups.Enabled = 0  ;False
$ListBoxAvailableGroups.Height = 121
$ListBoxAvailableGroups.Left = 145
$ListBoxAvailableGroups.SelectionMode = 3  ;MultiExtended
$ListBoxAvailableGroups.Top = 230
$ListBoxAvailableGroups.Width = 105
$nul = $GroupBoxAccountDetails.Controls.Add($ListBoxAvailableGroups)

$ButtonAccUpdate = $System.Button()
$ButtonAccUpdate.Enabled = 0  ;False
$ButtonAccUpdate.Left = 5
$ButtonAccUpdate.Text = "Update: >"
$ButtonAccUpdate.TextAlign = 16  ;MiddleLeft
$ButtonAccUpdate.Top = 365
$ButtonAccUpdate.Width = 245
$ButtonAccUpdate.Height = 20
$ButtonAccUpdate.Click = "UDF_UpdateUsers()"
$nul = $GroupBoxAccountDetails.Controls.Add($ButtonAccUpdate)

$ButtonDeleteUsers = $System.Button()
$ButtonDeleteUsers.Enabled = 0  ;False
$ButtonDeleteUsers.Left = 5
$ButtonDeleteUsers.Text = "Delete:  >"
$ButtonDeleteUsers.TextAlign = 16  ;MiddleLeft
$ButtonDeleteUsers.Top = 395
$ButtonDeleteUsers.Width = 245
$ButtonDeleteUsers.Height = 20
$ButtonDeleteUsers.Click = "UDF_DeleteUsers()"
$nul = $GroupBoxAccountDetails.Controls.Add($ButtonDeleteUsers)

;--------------
:GroupPassword
;--------------

$GroupBoxPassword = $System.GroupBox()
$GroupBoxPassword.Height = 145
$GroupBoxPassword.Left = 433
$GroupBoxPassword.Text = "Password"
$GroupBoxPassword.Top = 435
$GroupBoxPassword.Width = 255
$nul = $TabControlDelegateAdministratorTabPageGeneral.Controls.Add($GroupBoxPassword)

$LabelNewPW = $System.Label()
$LabelNewPW.Left = 5
$LabelNewPW.Text = "New"
$LabelNewPW.TextAlign = 16  ;MiddleLeft
$LabelNewPW.Top = 20
$LabelNewPW.Width = 50
$nul = $GroupBoxPassword.Controls.Add($LabelNewPW)

$TextBoxNewPW = $System.TextBox()
$TextBoxNewPW.Left = 60
$TextBoxNewPW.PasswordChar = asc("*")
$TextBoxNewPW.Text = ""
$TextBoxNewPW.Top = 20
$TextBoxNewPW.Width = 160
$nul = $GroupBoxPassword.Controls.Add($TextBoxNewPW)

$LabelConfirmPW = $System.Label()
$LabelConfirmPW.Left = 5
$LabelConfirmPW.Text = "Confirm"
$LabelConfirmPW.TextAlign = 16  ;MiddleLeft
$LabelConfirmPW.Top = 45
$LabelConfirmPW.Width = 50
$nul = $GroupBoxPassword.Controls.Add($LabelConfirmPW)

$TextBoxConfirmPW = $System.TextBox()
$TextBoxConfirmPW.Left = 60
$TextBoxConfirmPW.PasswordChar = asc("*")
$TextBoxConfirmPW.Text = ""
$TextBoxConfirmPW.Top = 45
$TextBoxConfirmPW.Width = 160
$TextBoxConfirmPW.KeyDown = "UDF_EnableButtonResetPW()"
$nul = $GroupBoxPassword.Controls.Add($TextBoxConfirmPW)

$CheckBoxChangeAtNextLogonPW = $System.CheckBox()
$CheckBoxChangeAtNextLogonPW.Height = 25
$CheckBoxChangeAtNextLogonPW.Left = 60
$CheckBoxChangeAtNextLogonPW.Text = "User must change password at next logon"
$CheckBoxChangeAtNextLogonPW.Top = 75
$CheckBoxChangeAtNextLogonPW.Width = 170
$nul = $GroupBoxPassword.Controls.Add($CheckBoxChangeAtNextLogonPW)

$ButtonSetPassword = $System.Button()
$ButtonSetPassword.Enabled = 0  ;False
$ButtonSetPassword.Left = 5
$ButtonSetPassword.Text = "Set Password"
$ButtonSetPassword.Top = 115
$ButtonSetPassword.Width = 245
$ButtonSetPassword.Click = "UDF_SetPassword()"
$nul = $GroupBoxPassword.Controls.Add($ButtonSetPassword)

;###############
:TabNewAccounts
;###############

;----------------
:GroupNewAccount
;----------------

$GroupBoxNewAccount = $System.GroupBox()
$GroupBoxNewAccount.Height = 105
$GroupBoxNewAccount.Left = 2
$GroupBoxNewAccount.Text = "New Account"
$GroupBoxNewAccount.Top = 0
$GroupBoxNewAccount.Width = 480
$nul = $TabControlDelegateAdministratorTabPageNewAccs.Controls.Add($GroupBoxNewAccount)

$LabelNewAccFirstName = $System.Label()
$LabelNewAccFirstName.Height = 20
$LabelNewAccFirstName.Left = 15
$LabelNewAccFirstName.Text = "First Name"
$LabelNewAccFirstName.TextAlign = 16  ;MiddleLeft
$LabelNewAccFirstName.Top = 15
$nul = $GroupBoxNewAccount.Controls.Add($LabelNewAccFirstName)

$TextBoxNewAccFirstName = $System.TextBox()
$TextBoxNewAccFirstName.Left = 15
$TextBoxNewAccFirstName.Text = ""
$TextBoxNewAccFirstName.Top = 35
$nul = $GroupBoxNewAccount.Controls.Add($TextBoxNewAccFirstName)

$LabelNewAccLastName = $System.Label()
$LabelNewAccLastName.Height = 20
$LabelNewAccLastName.Left = 120
$LabelNewAccLastName.Text = "Last Name"
$LabelNewAccLastName.TextAlign = 16  ;MiddleLeft
$LabelNewAccLastName.Top = 15
$nul = $GroupBoxNewAccount.Controls.Add($LabelNewAccLastName)

$TextBoxNewAccLastName = $System.TextBox()
$TextBoxNewAccLastName.Left = 120
$TextBoxNewAccLastName.Text = ""
$TextBoxNewAccLastName.Top = 35
$nul = $GroupBoxNewAccount.Controls.Add($TextBoxNewAccLastName)

$LabelNewAccCatagory = $System.Label()
$LabelNewAccCatagory.Height = 20
$LabelNewAccCatagory.Left = 225
$LabelNewAccCatagory.Text = "Catagory"
$LabelNewAccCatagory.TextAlign = 16  ;MiddleLeft
$LabelNewAccCatagory.Top = 15
$nul = $GroupBoxNewAccount.Controls.Add($LabelNewAccCatagory)

$ComboBoxNewAccCatagory = $System.ComboBox()
$ComboBoxNewAccCatagory.Height = 21
$ComboBoxNewAccCatagory.ItemHeight = 13
$ComboBoxNewAccCatagory.Left = 225
$ComboBoxNewAccCatagory.Text = ""
$ComboBoxNewAccCatagory.Top = 35
$nul = $GroupBoxNewAccount.Controls.Add($ComboBoxNewAccCatagory)

$ComboBoxNewAccCatagoryItem0 = $ComboBoxNewAccCatagory.Items.Add("Pupil")
$ComboBoxNewAccCatagoryItem1 = $ComboBoxNewAccCatagory.Items.Add("Senior Teacher")
$ComboBoxNewAccCatagoryItem2 = $ComboBoxNewAccCatagory.Items.Add("Junior Teacher")
$ComboBoxNewAccCatagoryItem3 = $ComboBoxNewAccCatagory.Items.Add("LSA")
$ComboBoxNewAccCatagoryItem4 = $ComboBoxNewAccCatagory.Items.Add("Office")

$LabelNewAccClass = $System.Label()
$LabelNewAccClass.Height = 20
$LabelNewAccClass.Left = 350
$LabelNewAccClass.Text = "Class"
$LabelNewAccClass.TextAlign = 16  ;MiddleLeft
$LabelNewAccClass.Top = 15
$nul = $GroupBoxNewAccount.Controls.Add($LabelNewAccClass)

$ComboBoxNewAccClass = $System.ComboBox()
$ComboBoxNewAccClass.Enabled = 0  ;False
$ComboBoxNewAccClass.Height = 21
$ComboBoxNewAccClass.ItemHeight = 13
$ComboBoxNewAccClass.Left = 350
$ComboBoxNewAccClass.Text = ""
$ComboBoxNewAccClass.Top = 35
$nul = $GroupBoxNewAccount.Controls.Add($ComboBoxNewAccClass)

$LabelNewAccDOB = $System.Label()
$LabelNewAccDOB.Height = 15
$LabelNewAccDOB.Left = 15
$LabelNewAccDOB.Text = "Date Of Birth"
$LabelNewAccDOB.TextAlign = 16  ;MiddleLeft
$LabelNewAccDOB.Top = 60
$nul = $GroupBoxNewAccount.Controls.Add($LabelNewAccDOB)

$ComboBoxNewAccDOBDay = $System.ComboBox()
$ComboBoxNewAccDOBDay.DropDownWidth = 40
$ComboBoxNewAccDOBDay.Height = 21
$ComboBoxNewAccDOBDay.ItemHeight = 13
$ComboBoxNewAccDOBDay.MaxDropDownItems = 31
$ComboBoxNewAccDOBDay.Left = 15
$ComboBoxNewAccDOBDay.Text = "D"
$ComboBoxNewAccDOBDay.Top = 75
$ComboBoxNewAccDOBDay.Width = 40
$nul = $GroupBoxNewAccount.Controls.Add($ComboBoxNewAccDOBDay)

$ComboBoxNewAccDOBDayItem0 = $ComboBoxNewAccDOBDay.Items.Add("01")
$ComboBoxNewAccDOBDayItem1 = $ComboBoxNewAccDOBDay.Items.Add("02")
$ComboBoxNewAccDOBDayItem2 = $ComboBoxNewAccDOBDay.Items.Add("03")
$ComboBoxNewAccDOBDayItem3 = $ComboBoxNewAccDOBDay.Items.Add("04")
$ComboBoxNewAccDOBDayItem4 = $ComboBoxNewAccDOBDay.Items.Add("05")
$ComboBoxNewAccDOBDayItem5 = $ComboBoxNewAccDOBDay.Items.Add("06")
$ComboBoxNewAccDOBDayItem6 = $ComboBoxNewAccDOBDay.Items.Add("07")
$ComboBoxNewAccDOBDayItem7 = $ComboBoxNewAccDOBDay.Items.Add("08")
$ComboBoxNewAccDOBDayItem8 = $ComboBoxNewAccDOBDay.Items.Add("09")
$ComboBoxNewAccDOBDayItem9 = $ComboBoxNewAccDOBDay.Items.Add("10")
$ComboBoxNewAccDOBDayItem10 = $ComboBoxNewAccDOBDay.Items.Add("11")
$ComboBoxNewAccDOBDayItem11 = $ComboBoxNewAccDOBDay.Items.Add("12")
$ComboBoxNewAccDOBDayItem12 = $ComboBoxNewAccDOBDay.Items.Add("13")
$ComboBoxNewAccDOBDayItem13 = $ComboBoxNewAccDOBDay.Items.Add("14")
$ComboBoxNewAccDOBDayItem14 = $ComboBoxNewAccDOBDay.Items.Add("15")
$ComboBoxNewAccDOBDayItem15 = $ComboBoxNewAccDOBDay.Items.Add("16")
$ComboBoxNewAccDOBDayItem16 = $ComboBoxNewAccDOBDay.Items.Add("17")
$ComboBoxNewAccDOBDayItem17 = $ComboBoxNewAccDOBDay.Items.Add("18")
$ComboBoxNewAccDOBDayItem18 = $ComboBoxNewAccDOBDay.Items.Add("19")
$ComboBoxNewAccDOBDayItem19 = $ComboBoxNewAccDOBDay.Items.Add("20")
$ComboBoxNewAccDOBDayItem20 = $ComboBoxNewAccDOBDay.Items.Add("21")
$ComboBoxNewAccDOBDayItem21 = $ComboBoxNewAccDOBDay.Items.Add("22")
$ComboBoxNewAccDOBDayItem22 = $ComboBoxNewAccDOBDay.Items.Add("23")
$ComboBoxNewAccDOBDayItem23 = $ComboBoxNewAccDOBDay.Items.Add("24")
$ComboBoxNewAccDOBDayItem24 = $ComboBoxNewAccDOBDay.Items.Add("25")
$ComboBoxNewAccDOBDayItem25 = $ComboBoxNewAccDOBDay.Items.Add("26")
$ComboBoxNewAccDOBDayItem26 = $ComboBoxNewAccDOBDay.Items.Add("27")
$ComboBoxNewAccDOBDayItem27 = $ComboBoxNewAccDOBDay.Items.Add("28")
$ComboBoxNewAccDOBDayItem28 = $ComboBoxNewAccDOBDay.Items.Add("29")
$ComboBoxNewAccDOBDayItem29 = $ComboBoxNewAccDOBDay.Items.Add("30")
$ComboBoxNewAccDOBDayItem30 = $ComboBoxNewAccDOBDay.Items.Add("31")

$ComboBoxNewAccDOBMonth = $System.ComboBox()
$ComboBoxNewAccDOBMonth.DropDownWidth = 40
$ComboBoxNewAccDOBMonth.Height = 21
$ComboBoxNewAccDOBMonth.ItemHeight = 13
$ComboBoxNewAccDOBMonth.MaxDropDownItems = 12
$ComboBoxNewAccDOBMonth.Left = 55
$ComboBoxNewAccDOBMonth.Text = "M"
$ComboBoxNewAccDOBMonth.Top = 75
$ComboBoxNewAccDOBMonth.Width = 40
$nul = $GroupBoxNewAccount.Controls.Add($ComboBoxNewAccDOBMonth)

$ComboBoxNewAccDOBMonthItem0 = $ComboBoxNewAccDOBMonth.Items.Add("01")
$ComboBoxNewAccDOBMonthItem1 = $ComboBoxNewAccDOBMonth.Items.Add("02")
$ComboBoxNewAccDOBMonthItem2 = $ComboBoxNewAccDOBMonth.Items.Add("03")
$ComboBoxNewAccDOBMonthItem3 = $ComboBoxNewAccDOBMonth.Items.Add("04")
$ComboBoxNewAccDOBMonthItem4 = $ComboBoxNewAccDOBMonth.Items.Add("05")
$ComboBoxNewAccDOBMonthItem5 = $ComboBoxNewAccDOBMonth.Items.Add("06")
$ComboBoxNewAccDOBMonthItem6 = $ComboBoxNewAccDOBMonth.Items.Add("07")
$ComboBoxNewAccDOBMonthItem7 = $ComboBoxNewAccDOBMonth.Items.Add("08")
$ComboBoxNewAccDOBMonthItem8 = $ComboBoxNewAccDOBMonth.Items.Add("09")
$ComboBoxNewAccDOBMonthItem9 = $ComboBoxNewAccDOBMonth.Items.Add("10")
$ComboBoxNewAccDOBMonthItem10 = $ComboBoxNewAccDOBMonth.Items.Add("11")
$ComboBoxNewAccDOBMonthItem11 = $ComboBoxNewAccDOBMonth.Items.Add("12")

$ComboBoxNewAccDOBYear = $System.ComboBox()
$ComboBoxNewAccDOBYear.DropDownWidth = 55
$ComboBoxNewAccDOBYear.Height = 21
$ComboBoxNewAccDOBYear.ItemHeight = 13
$ComboBoxNewAccDOBYear.MaxDropDownItems = 61
$ComboBoxNewAccDOBYear.Left = 95
$ComboBoxNewAccDOBYear.Text = "Year"
$ComboBoxNewAccDOBYear.Top = 75
$ComboBoxNewAccDOBYear.Width = 55
$nul = $GroupBoxNewAccount.Controls.Add($ComboBoxNewAccDOBYear)

$ComboBoxNewAccDOBYearItem0 = $ComboBoxNewAccDOBYear.Items.Add("1950")
$ComboBoxNewAccDOBYearItem1 = $ComboBoxNewAccDOBYear.Items.Add("1951")
$ComboBoxNewAccDOBYearItem2 = $ComboBoxNewAccDOBYear.Items.Add("1952")
$ComboBoxNewAccDOBYearItem3 = $ComboBoxNewAccDOBYear.Items.Add("1953")
$ComboBoxNewAccDOBYearItem4 = $ComboBoxNewAccDOBYear.Items.Add("1954")
$ComboBoxNewAccDOBYearItem5 = $ComboBoxNewAccDOBYear.Items.Add("1955")
$ComboBoxNewAccDOBYearItem6 = $ComboBoxNewAccDOBYear.Items.Add("1956")
$ComboBoxNewAccDOBYearItem7 = $ComboBoxNewAccDOBYear.Items.Add("1957")
$ComboBoxNewAccDOBYearItem8 = $ComboBoxNewAccDOBYear.Items.Add("1958")
$ComboBoxNewAccDOBYearItem9 = $ComboBoxNewAccDOBYear.Items.Add("1959")
$ComboBoxNewAccDOBYearItem10 = $ComboBoxNewAccDOBYear.Items.Add("1960")
$ComboBoxNewAccDOBYearItem11 = $ComboBoxNewAccDOBYear.Items.Add("1961")
$ComboBoxNewAccDOBYearItem12 = $ComboBoxNewAccDOBYear.Items.Add("1962")
$ComboBoxNewAccDOBYearItem13 = $ComboBoxNewAccDOBYear.Items.Add("1963")
$ComboBoxNewAccDOBYearItem14 = $ComboBoxNewAccDOBYear.Items.Add("1964")
$ComboBoxNewAccDOBYearItem15 = $ComboBoxNewAccDOBYear.Items.Add("1965")
$ComboBoxNewAccDOBYearItem16 = $ComboBoxNewAccDOBYear.Items.Add("1966")
$ComboBoxNewAccDOBYearItem17 = $ComboBoxNewAccDOBYear.Items.Add("1967")
$ComboBoxNewAccDOBYearItem18 = $ComboBoxNewAccDOBYear.Items.Add("1968")
$ComboBoxNewAccDOBYearItem19 = $ComboBoxNewAccDOBYear.Items.Add("1969")
$ComboBoxNewAccDOBYearItem20 = $ComboBoxNewAccDOBYear.Items.Add("1970")
$ComboBoxNewAccDOBYearItem21 = $ComboBoxNewAccDOBYear.Items.Add("1971")
$ComboBoxNewAccDOBYearItem22 = $ComboBoxNewAccDOBYear.Items.Add("1972")
$ComboBoxNewAccDOBYearItem23 = $ComboBoxNewAccDOBYear.Items.Add("1973")
$ComboBoxNewAccDOBYearItem24 = $ComboBoxNewAccDOBYear.Items.Add("1974")
$ComboBoxNewAccDOBYearItem25 = $ComboBoxNewAccDOBYear.Items.Add("1975")
$ComboBoxNewAccDOBYearItem26 = $ComboBoxNewAccDOBYear.Items.Add("1976")
$ComboBoxNewAccDOBYearItem27 = $ComboBoxNewAccDOBYear.Items.Add("1977")
$ComboBoxNewAccDOBYearItem28 = $ComboBoxNewAccDOBYear.Items.Add("1978")
$ComboBoxNewAccDOBYearItem29 = $ComboBoxNewAccDOBYear.Items.Add("1979")
$ComboBoxNewAccDOBYearItem30 = $ComboBoxNewAccDOBYear.Items.Add("1980")
$ComboBoxNewAccDOBYearItem31 = $ComboBoxNewAccDOBYear.Items.Add("1981")
$ComboBoxNewAccDOBYearItem32 = $ComboBoxNewAccDOBYear.Items.Add("1982")
$ComboBoxNewAccDOBYearItem33 = $ComboBoxNewAccDOBYear.Items.Add("1983")
$ComboBoxNewAccDOBYearItem34 = $ComboBoxNewAccDOBYear.Items.Add("1984")
$ComboBoxNewAccDOBYearItem35 = $ComboBoxNewAccDOBYear.Items.Add("1985")
$ComboBoxNewAccDOBYearItem36 = $ComboBoxNewAccDOBYear.Items.Add("1986")
$ComboBoxNewAccDOBYearItem37 = $ComboBoxNewAccDOBYear.Items.Add("1987")
$ComboBoxNewAccDOBYearItem38 = $ComboBoxNewAccDOBYear.Items.Add("1988")
$ComboBoxNewAccDOBYearItem39 = $ComboBoxNewAccDOBYear.Items.Add("1989")
$ComboBoxNewAccDOBYearItem40 = $ComboBoxNewAccDOBYear.Items.Add("1990")
$ComboBoxNewAccDOBYearItem41 = $ComboBoxNewAccDOBYear.Items.Add("1991")
$ComboBoxNewAccDOBYearItem42 = $ComboBoxNewAccDOBYear.Items.Add("1992")
$ComboBoxNewAccDOBYearItem43 = $ComboBoxNewAccDOBYear.Items.Add("1993")
$ComboBoxNewAccDOBYearItem44 = $ComboBoxNewAccDOBYear.Items.Add("1994")
$ComboBoxNewAccDOBYearItem45 = $ComboBoxNewAccDOBYear.Items.Add("1995")
$ComboBoxNewAccDOBYearItem46 = $ComboBoxNewAccDOBYear.Items.Add("1996")
$ComboBoxNewAccDOBYearItem47 = $ComboBoxNewAccDOBYear.Items.Add("1997")
$ComboBoxNewAccDOBYearItem48 = $ComboBoxNewAccDOBYear.Items.Add("1998")
$ComboBoxNewAccDOBYearItem49 = $ComboBoxNewAccDOBYear.Items.Add("1999")
$ComboBoxNewAccDOBYearItem50 = $ComboBoxNewAccDOBYear.Items.Add("2000")
$ComboBoxNewAccDOBYearItem51 = $ComboBoxNewAccDOBYear.Items.Add("2001")
$ComboBoxNewAccDOBYearItem52 = $ComboBoxNewAccDOBYear.Items.Add("2002")
$ComboBoxNewAccDOBYearItem53 = $ComboBoxNewAccDOBYear.Items.Add("2003")
$ComboBoxNewAccDOBYearItem54 = $ComboBoxNewAccDOBYear.Items.Add("2004")
$ComboBoxNewAccDOBYearItem55 = $ComboBoxNewAccDOBYear.Items.Add("2005")
$ComboBoxNewAccDOBYearItem56 = $ComboBoxNewAccDOBYear.Items.Add("2006")
$ComboBoxNewAccDOBYearItem57 = $ComboBoxNewAccDOBYear.Items.Add("2007")
$ComboBoxNewAccDOBYearItem58 = $ComboBoxNewAccDOBYear.Items.Add("2008")
$ComboBoxNewAccDOBYearItem59 = $ComboBoxNewAccDOBYear.Items.Add("2009")
$ComboBoxNewAccDOBYearItem60 = $ComboBoxNewAccDOBYear.Items.Add("2010")

$ButtonNewAccAddToList = $System.Button()
$ButtonNewAccAddToList.Height = 20
$ButtonNewAccAddToList.Left = 225
$ButtonNewAccAddToList.Text = "Add To List"
$ButtonNewAccAddToList.Top = 75
$ButtonNewAccAddToList.Width = 120
$nul = $GroupBoxNewAccount.Controls.Add($ButtonNewAccAddToList)

$ButtonNewAccListUpdateSelected = $System.Button()
$ButtonNewAccListUpdateSelected.Enabled = 0  ;False
$ButtonNewAccListUpdateSelected.Height = 20
$ButtonNewAccListUpdateSelected.Left = 350
$ButtonNewAccListUpdateSelected.Text = "Update Selected"
$ButtonNewAccListUpdateSelected.Top = 75
$ButtonNewAccListUpdateSelected.Width = 120
$nul = $GroupBoxNewAccount.Controls.Add($ButtonNewAccListUpdateSelected)

;------------------------
:GroupAccountToBeCreated
;------------------------

$GroupBoxAccountsToBeCreated = $System.GroupBox()
$GroupBoxAccountsToBeCreated.Height = 425
$GroupBoxAccountsToBeCreated.Left = 2
$GroupBoxAccountsToBeCreated.Text = "Accounts To Be Created"
$GroupBoxAccountsToBeCreated.Top = 115
$GroupBoxAccountsToBeCreated.Width = 685
$nul = $TabControlDelegateAdministratorTabPageNewAccs.Controls.Add($GroupBoxAccountsToBeCreated)

$CheckBoxNewAccListAllowUpdates = $System.CheckBox()
$CheckBoxNewAccListAllowUpdates.Left = 10
$CheckBoxNewAccListAllowUpdates.Text = "Allow Updates"
$CheckBoxNewAccListAllowUpdates.Top = 15
$nul = $GroupBoxAccountsToBeCreated.Controls.Add($CheckBoxNewAccListAllowUpdates)

$ButtonNewAccListRemoveSelected = $System.Button()
$ButtonNewAccListRemoveSelected.Enabled = 0  ;False
$ButtonNewAccListRemoveSelected.Left = 120
$ButtonNewAccListRemoveSelected.Text = "Remove Selected"
$ButtonNewAccListRemoveSelected.Top = 15
$ButtonNewAccListRemoveSelected.Width = 115
$nul = $GroupBoxAccountsToBeCreated.Controls.Add($ButtonNewAccListRemoveSelected)

$ListViewNewAccList = $System.ListView()
$ListViewNewAccList.CheckBoxes = -1  ;True
$ListViewNewAccList.FullRowSelect = -1  ;True
$ListViewNewAccList.GridLines = -1  ;True
$ListViewNewAccList.Height = 375
$ListViewNewAccList.HideSelection = 0  ;False
$ListViewNewAccList.Left = 5
$ListViewNewAccList.Top = 45
$ListViewNewAccList.Width = 675
$ListViewNewAccList.View = $System.View_Details
$nul = $GroupBoxAccountsToBeCreated.Controls.Add($ListViewNewAccList)

$ListViewNewAccListColumn0 = $ListViewNewAccList.Columns.Add($System.ColumnHeader("Full Name",111,$System.HorizontalAlignment_Left))
$ListViewNewAccListColumn1 = $ListViewNewAccList.Columns.Add($System.ColumnHeader("First Name",80,$System.HorizontalAlignment_Center))
$ListViewNewAccListColumn2 = $ListViewNewAccList.Columns.Add($System.ColumnHeader("Last Name",80,$System.HorizontalAlignment_Center))
$ListViewNewAccListColumn3 = $ListViewNewAccList.Columns.Add($System.ColumnHeader("UserName",80,$System.HorizontalAlignment_Center))
$ListViewNewAccListColumn4 = $ListViewNewAccList.Columns.Add($System.ColumnHeader("Password",80,$System.HorizontalAlignment_Center))
$ListViewNewAccListColumn5 = $ListViewNewAccList.Columns.Add($System.ColumnHeader("DOB",80,$System.HorizontalAlignment_Center))
$ListViewNewAccListColumn6 = $ListViewNewAccList.Columns.Add($System.ColumnHeader("Catagory",80,$System.HorizontalAlignment_Center))
$ListViewNewAccListColumn7 = $ListViewNewAccList.Columns.Add($System.ColumnHeader("Class",80,$System.HorizontalAlignment_Center))

$ButtonNewAccListImport = $System.Button()
$ButtonNewAccListImport.Left = 2
$ButtonNewAccListImport.Text = "Import List ..."
$ButtonNewAccListImport.Top = 550
$ButtonNewAccListImport.Width = 120
$nul = $TabControlDelegateAdministratorTabPageNewAccs.Controls.Add($ButtonNewAccListImport)

$ButtonNewAccsCreate = $System.Button()
$ButtonNewAccsCreate.Left = 567
$ButtonNewAccsCreate.Text = "Create Account/s"
$ButtonNewAccsCreate.Top = 550
$ButtonNewAccsCreate.Width = 120
$nul = $TabControlDelegateAdministratorTabPageNewAccs.Controls.Add($ButtonNewAccsCreate)

;######################
:TabCLAITAdministrator
;######################



;#################
:TabAbout
;#################

;-----------------
:GroupAboutInfo
;-----------------

$GroupBoxAboutInformation = $System.GroupBox()
$GroupBoxAboutInformation.Height = 90
$GroupBoxAboutInformation.Left = 2
$GroupBoxAboutInformation.Text = "Information"
$GroupBoxAboutInformation.Top = 0
$GroupBoxAboutInformation.Width = 470
$nul = $TabControlDelegateAdministratorTabPageAbout.Controls.Add($GroupBoxAboutInformation)

$LabelAboutInfoAppName = $System.Label()
$LabelAboutInfoAppName.BorderStyle = 2  ;Fixed3D
$LabelAboutInfoAppName.Left = 10
$LabelAboutInfoAppName.Text = "Delegate Administrator"
$LabelAboutInfoAppName.TextAlign = 32  ;MiddleCenter
$LabelAboutInfoAppName.Top = 20
$LabelAboutInfoAppName.Width = 115
$nul = $GroupBoxAboutInformation.Controls.Add($LabelAboutInfoAppName)

$LabelAboutInfoVersion = $System.Label()
$LabelAboutInfoVersion.BorderStyle = 2  ;Fixed3D
$LabelAboutInfoVersion.Left = 20
$LabelAboutInfoVersion.Text = "Version: 1.0"
$LabelAboutInfoVersion.TextAlign = 32  ;MiddleCenter
$LabelAboutInfoVersion.Top = 45
$LabelAboutInfoVersion.Width = 95
$nul = $GroupBoxAboutInformation.Controls.Add($LabelAboutInfoVersion)

$LabelAboutInfoAuthor = $System.Label()
$LabelAboutInfoAuthor.Height = 20
$LabelAboutInfoAuthor.Left = 145
$LabelAboutInfoAuthor.Text = "Author: Ken Hamilton"
$LabelAboutInfoAuthor.TextAlign = 16  ;MiddleLeft
$LabelAboutInfoAuthor.Top = 15
$LabelAboutInfoAuthor.Width = 115
$nul = $GroupBoxAboutInformation.Controls.Add($LabelAboutInfoAuthor)

$LabelAboutInfoMisc = $System.Label()
$LabelAboutInfoMisc.Height = 30
$LabelAboutInfoMisc.Left = 145
$LabelAboutInfoMisc.Text = "KiXtart 2010 (Version4.5.1) & KiXForms.NET Script Build Date: 5th November 2005"
$LabelAboutInfoMisc.TextAlign = 16  ;MiddleLeft
$LabelAboutInfoMisc.Top = 40
$LabelAboutInfoMisc.Width = 250
$nul = $GroupBoxAboutInformation.Controls.Add($LabelAboutInfoMisc)

;-------------------
:GroupAboutSettings
;-------------------

$GroupBoxAboutSettings = $System.GroupBox()
$GroupBoxAboutSettings.Height = 295
$GroupBoxAboutSettings.Left = 2
$GroupBoxAboutSettings.Text = "Settings"
$GroupBoxAboutSettings.Top = 90
$GroupBoxAboutSettings.Width = 470
$nul = $TabControlDelegateAdministratorTabPageAbout.Controls.Add($GroupBoxAboutSettings)

$LabelAboutSettingsParentOU = $System.Label()
$LabelAboutSettingsParentOU.Height = 20
$LabelAboutSettingsParentOU.Left = 5
$LabelAboutSettingsParentOU.Text = "Parent OU"
$LabelAboutSettingsParentOU.TextAlign = 16  ;MiddleLeft
$LabelAboutSettingsParentOU.Top = 15
$nul = $GroupBoxAboutSettings.Controls.Add($LabelAboutSettingsParentOU)

$ComboBoxABoutSettingsParentOU = $System.ComboBox()
$ComboBoxABoutSettingsParentOU.Height = 21
$ComboBoxABoutSettingsParentOU.ItemHeight = 13
$ComboBoxABoutSettingsParentOU.Left = 5
$ComboBoxABoutSettingsParentOU.Text = "Pupils"
$ComboBoxABoutSettingsParentOU.Top = 35
$nul = $GroupBoxAboutSettings.Controls.Add($ComboBoxABoutSettingsParentOU)

$ComboBoxABoutSettingsParentOUItem0 = $ComboBoxABoutSettingsParentOU.Items.Add("Pupils")
$ComboBoxABoutSettingsParentOUItem1 = $ComboBoxABoutSettingsParentOU.Items.Add("Staff")

$LabelAboutSettingsParentGroupOU = $System.Label()
$LabelAboutSettingsParentGroupOU.Height = 20
$LabelAboutSettingsParentGroupOU.Left = 5
$LabelAboutSettingsParentGroupOU.Text = "Parent Group OU"
$LabelAboutSettingsParentGroupOU.TextAlign = 16  ;MiddleLeft
$LabelAboutSettingsParentGroupOU.Top = 65
$LabelAboutSettingsParentGroupOU.Width = 130
$nul = $GroupBoxAboutSettings.Controls.Add($LabelAboutSettingsParentGroupOU)

$TextBoxAboutSettingsParentGroupOU = $System.TextBox()
$TextBoxAboutSettingsParentGroupOU.Left = 5
$TextBoxAboutSettingsParentGroupOU.Text = "Domain Groups"
$TextBoxAboutSettingsParentGroupOU.Top = 85
$TextBoxAboutSettingsParentGroupOU.Width = 120
$nul = $GroupBoxAboutSettings.Controls.Add($TextBoxAboutSettingsParentGroupOU)

$LabelAboutSettingsChildGroupOU = $System.Label()
$LabelAboutSettingsChildGroupOU.Height = 20
$LabelAboutSettingsChildGroupOU.Left = 160
$LabelAboutSettingsChildGroupOU.Text = "Child Group OU"
$LabelAboutSettingsChildGroupOU.TextAlign = 16  ;MiddleLeft
$LabelAboutSettingsChildGroupOU.Top = 65
$LabelAboutSettingsChildGroupOU.Width = 130
$nul = $GroupBoxAboutSettings.Controls.Add($LabelAboutSettingsChildGroupOU)

$TextBoxAboutSettingsChildGroupOU = $System.TextBox()
$TextBoxAboutSettingsChildGroupOU.Left = 160
$TextBoxAboutSettingsChildGroupOU.Text = "Years"
$TextBoxAboutSettingsChildGroupOU.Top = 85
$TextBoxAboutSettingsChildGroupOU.Width = 120
$nul = $GroupBoxAboutSettings.Controls.Add($TextBoxAboutSettingsChildGroupOU)

$LabelAboutSettingsSubChildGroupOU = $System.Label()
$LabelAboutSettingsSubChildGroupOU.Height = 20
$LabelAboutSettingsSubChildGroupOU.Left = 315
$LabelAboutSettingsSubChildGroupOU.Text = "Sub-Child Group OU"
$LabelAboutSettingsSubChildGroupOU.TextAlign = 16  ;MiddleLeft
$LabelAboutSettingsSubChildGroupOU.Top = 65
$LabelAboutSettingsSubChildGroupOU.Width = 130
$nul = $GroupBoxAboutSettings.Controls.Add($LabelAboutSettingsSubChildGroupOU)

$TextBoxAboutSettingsSubChildGroupOU = $System.TextBox()
$TextBoxAboutSettingsSubChildGroupOU.Left = 315
$TextBoxAboutSettingsSubChildGroupOU.Text = "Classes"
$TextBoxAboutSettingsSubChildGroupOU.Top = 85
$TextBoxAboutSettingsSubChildGroupOU.Width = 120
$nul = $GroupBoxAboutSettings.Controls.Add($TextBoxAboutSettingsSubChildGroupOU)
$LabelAboutSettingsHomePathPupil = $System.Label()
$LabelAboutSettingsHomePathPupil.Height = 20
$LabelAboutSettingsHomePathPupil.Left = 5
$LabelAboutSettingsHomePathPupil.Text = "Default Home Path (Pupil)"
$LabelAboutSettingsHomePathPupil.TextAlign = 16  ;MiddleLeft
$LabelAboutSettingsHomePathPupil.Top = 115
$LabelAboutSettingsHomePathPupil.Width = 140
$nul = $GroupBoxAboutSettings.Controls.Add($LabelAboutSettingsHomePathPupil)

$TextBoxAboutSettingsHomePathPupil = $System.TextBox()
$TextBoxAboutSettingsHomePathPupil.Left = 5
$TextBoxAboutSettingsHomePathPupil.Text = "\\HAWLEYDC1\USERS$\PUPILS\%%USERNAME%%"
$TextBoxAboutSettingsHomePathPupil.Top = 135
$TextBoxAboutSettingsHomePathPupil.Width = 275
$nul = $GroupBoxAboutSettings.Controls.Add($TextBoxAboutSettingsHomePathPupil)

$LabelAboutSettingsHomePathStaff = $System.Label()
$LabelAboutSettingsHomePathStaff.Height = 20
$LabelAboutSettingsHomePathStaff.Left = 5
$LabelAboutSettingsHomePathStaff.Text = "Default Home Path (Staff)"
$LabelAboutSettingsHomePathStaff.TextAlign = 16  ;MiddleLeft
$LabelAboutSettingsHomePathStaff.Top = 165
$LabelAboutSettingsHomePathStaff.Width = 145
$nul = $GroupBoxAboutSettings.Controls.Add($LabelAboutSettingsHomePathStaff)

$TextBoxAboutSettingsHomePathStaff = $System.TextBox()
$TextBoxAboutSettingsHomePathStaff.Left = 5
$TextBoxAboutSettingsHomePathStaff.Text = "\\HAWLEYDC1\USERS$\STAFF\%%USERNAME%%"
$TextBoxAboutSettingsHomePathStaff.Top = 185
$TextBoxAboutSettingsHomePathStaff.Width = 275
$nul = $GroupBoxAboutSettings.Controls.Add($TextBoxAboutSettingsHomePathStaff)

$LabelAboutSettingsDefaultPWTeacher = $System.Label()
$LabelAboutSettingsDefaultPWTeacher.Height = 20
$LabelAboutSettingsDefaultPWTeacher.Left = 315
$LabelAboutSettingsDefaultPWTeacher.Text = "Default Password (Teacher)"
$LabelAboutSettingsDefaultPWTeacher.TextAlign = 16  ;MiddleLeft
$LabelAboutSettingsDefaultPWTeacher.Top = 165
$LabelAboutSettingsDefaultPWTeacher.Width = 150
$nul = $GroupBoxAboutSettings.Controls.Add($LabelAboutSettingsDefaultPWTeacher)

$TextBoxAboutSettingsDefaultPWTeacher = $System.TextBox()
$TextBoxAboutSettingsDefaultPWTeacher.Left = 315
$TextBoxAboutSettingsDefaultPWTeacher.Text = "teacher"
$TextBoxAboutSettingsDefaultPWTeacher.Top = 185
$TextBoxAboutSettingsDefaultPWTeacher.Width = 120
$nul = $GroupBoxAboutSettings.Controls.Add($TextBoxAboutSettingsDefaultPWTeacher)

$LabelAboutSettingsHomePathCLAIT = $System.Label()
$LabelAboutSettingsHomePathCLAIT.Height = 20
$LabelAboutSettingsHomePathCLAIT.Left = 5
$LabelAboutSettingsHomePathCLAIT.Text = "Default Home Path (CLAIT)"
$LabelAboutSettingsHomePathCLAIT.TextAlign = 16  ;MiddleLeft
$LabelAboutSettingsHomePathCLAIT.Top = 215
$LabelAboutSettingsHomePathCLAIT.Width = 145
$nul = $GroupBoxAboutSettings.Controls.Add($LabelAboutSettingsHomePathCLAIT)

$TextBoxAboutSettingsHomePathCLAIT = $System.TextBox()
$TextBoxAboutSettingsHomePathCLAIT.Left = 5
$TextBoxAboutSettingsHomePathCLAIT.Text = "\\HAWLEYDC1\CLAIT$\PUPILS\%%USERNAME%%"
$TextBoxAboutSettingsHomePathCLAIT.Top = 235
$TextBoxAboutSettingsHomePathCLAIT.Width = 275
$nul = $GroupBoxAboutSettings.Controls.Add($TextBoxAboutSettingsHomePathCLAIT)

$ButtonAboutSettingsSaveChanges = $System.Button()
$ButtonAboutSettingsSaveChanges.Left = 375
$ButtonAboutSettingsSaveChanges.Text = "Save Changes"
$ButtonAboutSettingsSaveChanges.Top = 265
$ButtonAboutSettingsSaveChanges.Width = 90
$nul = $GroupBoxAboutSettings.Controls.Add($ButtonAboutSettingsSaveChanges)

$ButtonCloseForm = $System.Button()
$ButtonCloseForm.Left = 625
$ButtonCloseForm.Text = "Close"
$ButtonCloseForm.Top = 615
$ButtonCloseForm.Click = "quit"
$nul = $FormDelegateAdministrator.Controls.Add($ButtonCloseForm)

$ProgressBar = $System.ProgressBar()
$ProgressBar.Left = 5
$ProgressBar.Text = ""
$ProgressBar.Top = 615
$ProgressBar.Width = 611
$ProgressBar.Click = "quit"
$nul = $FormDelegateAdministrator.Controls.Add($ProgressBar)

$FormDelegateAdministrator.Activated = "UDF_GetClasses()"
$FormDelegateAdministrator.AcceptButton = $Modify
$FormDelegateAdministrator.Show  ;Displays the Form

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

Function UDF_GetClasses()   

   $ComboBoxClass1.Items.Clear
   $ComboBoxClass2.Items.Clear
   
   $ParentGroupOU = "ou=" + $TextBoxAboutSettingsParentGroupOU.Text
   
   If $TextBoxAboutSettingsChildGroupOU.Text <> ""
      $ChildGroupOU = "ou=" + $TextBoxAboutSettingsChildGroupOU.Text + ", "
   Else
      $ChildGroupOU = ""
   EndIf
   
   If $TextBoxAboutSettingsSubChildGroupOU.Text <> ""
      $SubChildGroupOU = "ou=" + $TextBoxAboutSettingsSubChildGroupOU.Text + ", "
   Else
      $SubChildGroupOU = ""
   EndIf
   
   $ouList = GetObject("LDAP://" + $SubChildGroupOU + $ChildGroupOU + $ParentGroupOU +", dc=" + @Domain + ", dc=com")
   $ouList.Filter = "Group"
   
   For Each $ou in $ouList
      $Item = $ComboBoxClass1.Items.Add($ou.cn)
      $Item = $ComboBoxClass2.Items.Add($ou.cn)
   Next
   
      $objConnection = CreateObject("ADODB.Connection")
      $objConnection.Open("Provider=ADsDSOObject;")
      $objCommand = CreateObject("ADODB.Command")
      $objCommand.ActiveConnection = $objConnection
      
      $objCommand.Properties("Page Size").Value = 100
      $objCommand.Properties("Cache Results").Value = (NOT 1)   
      
EndFunction

Function UDF_ListUsers($Selection)      
   
   ; Determine which ListBox has been clicked
   
   If $Selection = "Class1"
      $ComboBox = $ComboBoxClass1
      $ListBox = $ListBoxClass1
   Else
      $ComboBox = $ComboBoxClass2
      $ListBox = $ListBoxClass2
   EndIf
   
   ; Determine top level OU that current Administrator has visibility of
   
   $ParentGroupOU = "ou=" + $TextBoxAboutSettingsParentGroupOU.Text
   
   If $TextBoxAboutSettingsChildGroupOU.Text <> ""
      $ChildGroupOU = "ou=" + $TextBoxAboutSettingsChildGroupOU.Text + ", "
   Else
      $ChildGroupOU = ""
   EndIf
   
   If $TextBoxAboutSettingsSubChildGroupOU.Text <> ""
      $SubChildGroupOU = "ou=" + $TextBoxAboutSettingsSubChildGroupOU.Text + ", "
   Else
      $SubChildGroupOU = ""
   EndIf
      
      $ListBox.Items.Clear
      $Counter = 0      

      $Group = GetObject("LDAP://cn=" + $ComboBox.Text + ", " +
         $SubChildGroupOU + $ChildGroupOU + $ParentGroupOU + ", dc=" + @Domain + ", dc=com")
      $Members = $Group.GetEx("member")         
      
      For Each $user in $Members
               
         $Name = Substr($User, InStr($User, "=")+1 , InStr($User, ",")-4)
         $Counter=$Counter+1
         $Item = $ListBox.Items.Add($Name)
               
      Next
      
EndFunction

Function UDF_ShowUserDetails($Selection)
   
   If $Selection = "Class1"
      If $ListBoxClass1.Text = ""
         Return
      EndIf
      $ListBox = $ListBoxClass1
      Else
      If $ListBoxClass2.Text = ""
         Return
      EndIf
      $ListBox = $ListBoxClass2
   EndIf
   
   If $ListBox.Text = ""
      Return 0
   EndIf
      
   $objCommand.CommandText = "<LDAP://OU=Pupils ,DC=" + @Domain + ", DC=com>; (&(objectClass=user)(cn=" + $ListBox.Text + "));AdsPath;Subtree"
   $objRecordSet = $objCommand.Execute()
   
   $usrPath = $objRecordSet.Fields('AdsPath')
   $adsUser = GetObject($usrPath)
   
   ;Show Logon and Name
   
   $TextBoxsAMAccountName.Text = $adsUser.sAMAccountName
   $TextBoxFirstName.Text = $adsUser.givenName
   $TextBoxLastName.Text = $adsUser.sn
   
   If $TextBoxFirstName.Text = ""
      $ButtonDeleteUsers.Text = "Delete:  > " + $TextBoxsAMAccountName.Text
      $ButtonAccUpdate.Text = "Update: > " + $TextBoxsAMAccountName.Text
   Else
      $ButtonDeleteUsers.Text = "Delete:  > " + $TextBoxFirstName.Text + " " + $TextBoxLastName.Text + "'s Account"
      $ButtonAccUpdate.Text = "Update: > " + $TextBoxFirstName.Text + " " + $TextBoxLastName.Text + "'s Account"
   EndIf
   
   ;Show Status ** (The userAccountControl attribute) **
   
   $intuserAccountControl = $adsUser.Get("userAccountControl")
   
   ;If $intuserAccountControl = ($intuserAccountControl | 1 ) ; Script
   ;EndIf
   ;If $intuserAccountControl = ($intuserAccountControl | 32 ) ; Password Not Required
   ;EndIf
   ;($intuserAccountControl | 128 ) ; Allow Encrypted Password
   ;EndIf
   
   If $intuserAccountControl = ($intuserAccountControl | 2 ) ; Account is Disabled
      $CheckBoxAccDisabled.Checked = 1
   Else
      $CheckBoxAccDisabled.Checked = 0
   EndIf
   
   If $intuserAccountControl = ($intuserAccountControl | 16 ) ; Account is Locked
      $CheckBoxAccLocked.Checked = 1
   Else
      $CheckBoxAccLocked.Checked = 0
   EndIf
   
   If $intuserAccountControl = ($intuserAccountControl |  64 ) ; User Cannot Change Password
      $CheckBoxCannotChangePW.Checked = 1
   Else
      $CheckBoxCannotChangePW.Checked = 0
   EndIf
   
   If $intuserAccountControl = ($intuserAccountControl | 65536 ) ; Password Never Expires
      $CheckBoxNeverExpiresPW.Checked = 1
   Else
      $CheckBoxNeverExpiresPW.Checked = 0
   EndIf   
   
   ;Show Group Membership
   
   $ListBoxGroupMembership.Items.Clear   
   $MemberOf = $adsUser.GetEx("memberOf")

   For Each $Group in $MemberOf
      $Name = Substr($Group, InStr($Group, "=")+1 , InStr($Group, ",")-4)
      $Item = $ListBoxGroupMembership.Items.Add($Name)
   Next
   
   ;Disable Password Reset Button
   $ButtonSetPassword.Enabled = 0 ;False
   ;Clear both PW TextBoxes
   $TextBoxNewPW.Text = ""
   $TextBoxConfirmPW.Text = ""
   
   
; $aAttributes = "AdsPath" 
; $sADsPath = "LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext") 
; $strFilter = "(&(objectClass=User)(Name=" + $ListBox.Text + "))" 

; $aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter) 
; $TextBoxNewPW.Text = $aResults[0,0]
   
      
EndFunction

Function UDF_MoveAccounts($Direction)
   
   $ProgressBar.Value = 0
   
   $Confirm = MessageBox("Are you sure you move these accounts?", "Password Reset Confirmation",1 , )
            Select
               
                Case $Confirm = 1 ;Yes
                   
                   ;#### Move Accounts ####
                   
                   Select
                   Case $Direction = "Class1toClass2"
                      $CB1 = $ComboBoxClass1
                      $LB1 = $ListBoxClass1
                      $CB2 = $ComboBoxClass2
                      $LB2 = $ListBoxClass2
                   Case $Direction = "Class2toClass1"
                      $CB1 = $ComboBoxClass2
                      $LB1 = $ListBoxClass2
                      $CB2 = $ComboBoxClass1
                      $LB2 = $ListBoxClass1
                   Case 1
                      Return
                   EndSelect
                   
                   $ProgressStep = Round(100 /$LB1.SelectedItems.Count ,0)
                      
                   
                   For Each $User In $LB1.SelectedItems
                     $objCommand.CommandText = "<LDAP://OU=Pupils ,DC=" + @Domain + ", DC=com>;
                        (&(objectClass=user)(cn=" + $User + "));AdsPath;Subtree"
                     $objRecordSet = $objCommand.Execute()
                     $usrPath = $objRecordSet.Fields('AdsPath')
                     $adsUser = GetObject($usrPath)
                     
                     ;Remove from Current Class $ComboBoxClass1.Text
                     $CurrentClass = GetObject("LDAP://cn=" + $CB1.Text +
                        " ,OU=Classes, OU=Years, OU=Domain Groups, DC=" + @Domain + ", DC=com")
                     $CurrentClass.Remove($adsUser.ADsPath)                     
                     
                     ;Remove from Current Year $ComboBoxClass1.Text -3
                     $CurrentYear = GetObject("LDAP://cn=" + Left($CB1.Text, 7) +
                        " ,OU=" + $TextBoxAboutSettingsChildGroupOU.Text + " , OU=" +
                           $TextBoxAboutSettingsParentGroupOU.Text + ", DC=" + @Domain + " ,DC=com")
                     $CurrentYear.Remove($adsUser.AdsPath)
                     
                     ;Add to destination Class $ComboBoxClass2.Text                     
                     $DestinationClass = GetObject("LDAP://cn=" + $CB2.Text +
                        " ,OU=" + $TextBoxAboutSettingsSubChildGroupOU.Text + " ,OU=" +
                           $TextBoxAboutSettingsChildGroupOU.Text + " , OU=" + $TextBoxAboutSettingsParentGroupOU.Text +
                              ", DC=" + @Domain + " ,DC=com")
                     $DestinationClass.Add($adsUser.ADsPath)
                                       
                     ;Add to destination Year $ComboBoxClass2.Text -3
                     $DestinationYear = GetObject("LDAP://cn=" + Left($CB2.Text, 7) +
                        " ,OU=" + $TextBoxAboutSettingsChildGroupOU.Text + " , OU=" +
                           $TextBoxAboutSettingsParentGroupOU.Text + ", DC=" + @Domain + " ,DC=com")
                     $DestinationYear.Add($adsUser.AdsPath)
                     
                     ;Move to Destination OU
                     
                     $dy = Left($CB2.Text, 7)
                     
                        If $dy = "Year 01" Or $dy = "Year 02" Or $dy = "Year 03" Or $DestinationYear = "Year 04"
                           $DestinationOU = "OU=Year 1-4, OU=" + $ComboBoxABoutSettingsParentOU.Text
                        EndIf
                           
                        If  $dy = "Year 05" Or $dy = "Year 06"
                           $DestinationOU = "OU=Year 5-6, OU=" + $ComboBoxABoutSettingsParentOU.Text
                        EndIf
                        
                        If $dy = "Year 07" Or $dy = "Year 08" Or $dy = "Year 09"
                           $DestinationOU = "OU=Year 7-9, OU=" + $ComboBoxABoutSettingsParentOU.Text
                        EndIf
                        
                        If $dy = "Year 10" Or $dy = "Year 11"
                           $DestinationOU = "OU=Year 10-11, OU=" + $ComboBoxABoutSettingsParentOU.Text
                        EndIf      
                        
                        $ = $adsUser.SetInfo            
                     
         
                        $objOU = GetObject("LDAP://" + $DestinationOU + ", DC=" + @Domain + ", dc=com")                        
                        $nul = $objOU.MoveHere($adsUser.ADsPath,"cn=" + $adsUser.cn)
                        
                        $ProgressBar.Value = $ProgressBar.Value + $ProgressStep
                        
                           
                  Next
                   

               Case $Confirm = 2 ;Cancel
               Return

             EndSelect
            
            ;Refresh $ListBoxClass2      
   
            $ = UDF_ListUsers("Class2")
            $ = UDF_ListUsers("Class1")
            $ProgressBar.Value = 0

EndFunction

Function UDF_UndoMove()
   
EndFunction

Function UDF_Class1SelectAll()   

   If $ListBoxClass1.SelectedIndex = -1
      For $x = 0 To ($ListBoxClass1.Items.Count -1) Step 1
         $ListBoxClass1.SelectedIndex = $x
      Next
   Else
      $ListBoxClass1.SelectedIndex = -1
   EndIf

EndFunction

Function UDF_Class2SelectAll()
   
   If $ListBoxClass2.SelectedIndex = -1
      For $x = 0 To ($ListBoxClass2.Items.Count -1) Step 1
      $ListBoxClass2.SelectedIndex = $x
      Next
   Else
      $ListBoxClass2.SelectedIndex = -1
   EndIf
   
EndFunction

Function UDF_EnableButtonResetPW()
   $ButtonSetPassword.Enabled = 1 ; True
EndFunction

Function UDF_SetPassword()
   $CurrentUser
   
   Select
      
      ;Check that an account has been selected
      Case $TextBoxsAMAccountName.text = ""
               $TextBoxNewPW.Text = ""
               $TextBoxConfirmPW.Text = ""
               $ButtonSetPassword.Enabled = 0 ;False
               Return
               
      ;Disallow blank passwords
      Case $TextBoxNewPW.Text = "" And $TextBoxConfirmPW.Text = ""
               $Confirm = MessageBox("The password must not be blank. Please try again.", "Error", 5, )          
                
                Select
                   Case $Confirm = 4
                      $TextBoxNewPW.Text = ""
                     $TextBoxConfirmPW.Text = ""
                     $TextBoxNewPW.Focus
                     $ButtonSetPassword.Enabled = 0 ;False
                  Case $Confirm = 2
                     $TextBoxNewPW.Text = ""
                     $TextBoxConfirmPW.Text = ""
                     $ListBoxClass1.Focus
                     $ButtonSetPassword.Enabled = 0 ;False
                EndSelect                
                Return
   
      ;Check that passwords match
      Case $TextBoxNewPW.Text = $TextBoxConfirmPW.Text
            $Confirm = MessageBox("Are you sure you want to change " +
               $ListBox.Text + "'s Password?", "Password Reset Confirmation",1 , )
            Select
                Case $Confirm = 1 ;Yes
                   ;
                   ;#### Set Password ####
                   ;
                   $TextBoxNewPW.Text = ""
                  $TextBoxConfirmPW.Text = ""
                  $TextBoxNewPW.Focus
                  $ButtonSetPassword.Enabled = 0 ;False
               Case $Confirm = 2 ;Cancel
                  $TextBoxNewPW.Text = ""
                  $TextBoxConfirmPW.Text = ""
                  $ListBoxClass1.Focus
                  $ButtonSetPassword.Enabled = 0 ;False
                EndSelect                
                Return
                
      ;If not, display a message that they do not match and exit the function          
      Case 1
             $Confirm = MessageBox("The passwords do not match. Please try again.", "Error", 5, )          
             Select
                Case $Confirm = 4 ;Retry
                   $TextBoxNewPW.Text = ""
                  $TextBoxConfirmPW.Text = ""
                  $TextBoxNewPW.Focus
                  $ButtonSetPassword.Enabled = 0 ;False
               Case $Confirm = 2 ;Cancel
                  $TextBoxNewPW.Text = ""
                  $TextBoxConfirmPW.Text = ""
                  $ListBoxClass1.Focus
                  $ButtonSetPassword.Enabled = 0 ;False             
             EndSelect   
             Return
          
   EndSelect
   
EndFunction

Function UDF_EnableAccDetailsModify()
   
   If $CheckBoxAccModify.CheckState = 1
      $TextBoxFirstName.Enabled = 1  ;True
      $TextBoxLastName.Enabled = 1  ;True
      $CheckBoxAccDisabled.Enabled = 1  ;True
      $CheckBoxAccLocked.Enabled = 1  ;True
      $ListBoxGroupMembership.Enabled = 1  ;True
      $ListBoxGroupMembership.BackColor = $System.Color.FromName("Window")
      $ListBoxAvailableGroups.Enabled = 1 ;True
      $ListBoxAvailableGroups.BackColor = $System.Color.FromName("Window")
      $ButtonRemoveFromGroup.Enabled = 1 ;True
      $ButtonAddToGroup.Enabled = 1 ;True
      $ButtonGroupMembershipSelectAll.Enabled = 1 ;True
      $ButtonAccUpdate.Enabled = 1  ;True
      $ButtonDeleteUsers.Enabled = 1  ;True
      $CheckBoxCannotChangePW.Enabled = 1  ;True
      $CheckBoxNeverExpiresPW.Enabled = 1  ;True
      
      $ = UDF_ShowAvailableGroups()
      
   Else
      $TextBoxFirstName.Enabled = 0  ;False
      $TextBoxLastName.Enabled = 0  ;False
      $CheckBoxAccDisabled.Enabled = 0  ;False
      $CheckBoxAccLocked.Enabled = 0  ;False
      $ListBoxGroupMembership.Enabled = 0  ;False
      $ListBoxGroupMembership.BackColor = $System.Color.FromName("InactiveBorder")
      $ListBoxAvailableGroups.Enabled = 0 ;False
      $ListBoxAvailableGroups.BackColor = $System.Color.FromName("InactiveBorder")
      $ButtonRemoveFromGroup.Enabled = 0 ;False
      $ButtonAddToGroup.Enabled = 0 ;False
      $ButtonGroupMembershipSelectAll.Enabled = 0 ;False
      $ButtonAccUpdate.Enabled = 0  ;False
      $ButtonDeleteUsers.Enabled = 0  ;False
      $CheckBoxCannotChangePW.Enabled = 0  ;False
      $CheckBoxNeverExpiresPW.Enabled = 0  ;False
      
      $ListBoxAvailableGroups.Items.Clear
      
   EndIf
   
   $TextBoxNewPW.Text = $Checked
   
EndFunction

Function UDF_ShowAvailableGroups()
   
   $ParentGroupOU = "ou=" + $TextBoxAboutSettingsParentGroupOU.Text
   
   If $TextBoxAboutSettingsChildGroupOU.Text <> ""
      $ChildGroupOU = "ou=" + $TextBoxAboutSettingsChildGroupOU.Text + ", "
   Else
      $ChildGroupOU = ""
   EndIf
   
   If $TextBoxAboutSettingsSubChildGroupOU.Text <> ""
      $SubChildGroupOU = "ou=" + $TextBoxAboutSettingsSubChildGroupOU.Text + ", "
   Else
      $SubChildGroupOU = ""
   EndIf
   
   $ListBoxAvailableGroups.Items.Clear   

   $Objects = GetObject("LDAP://" + $SubChildGroupOU + $ChildGroupOU + $ParentGroupOU + ", dc=" + @Domain + ", dc=com")
      $Objects.Filter = ("group")         
      
      For Each $Group in $Objects               
         $Item = $ListBoxAvailableGroups.Items.Add($Group.cn)               
      Next
         
EndFunction

Function UDF_UpdateUsers()
   
EndFunction

Function UDF_DeleteUsers()
   
EndFunction

Function UDF_GroupMembershipSelectAll()
   
EndFunction

Function UDF_RemoveFromGroup()
   
EndFunction

Function UDF_AddToGroup()
   
EndFunction

Function UDF_LoadSettings()
   
   
   
EndFunction

Function UDF_SaveSettings()
   
   
   
EndFunction
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sat Nov 05, 2005 8:34 pm    Post subject: Reply with quote

my god man, thats a beautiful thing you got there ...

anyways, there is a bit of "history" with the ProgressBar in kf.net ... up until today, to get the pbar to work in kf.net, I had to implement a completely custom version of the pbar - its not the "real" .net pbar - so your right, the drawing could be off by a pixel or two.

but heres the deal - I now have a way to support the real .net pbar in kf.net - and I just dropped this new method into kf.net for the next build - it behaves almost identically to the old kf.net pbar, except for:

1) The progress bar itself is the "segmented" variety (bar), not the "solid" bar type.

2) The BorderStyle property is not supported.

These two limitations are also limitations of the std .net progressbar as well.

Do you see any issues with me dropping this new std .net pbar into kf.net ?
Back to top
View user's profile Send private message
mercury
KiXforms Regular
KiXforms Regular


Joined: 10 Aug 2005
Posts: 50

PostPosted: Sat Nov 05, 2005 8:56 pm    Post subject: Reply with quote

High praise from the Man himself on my first effort. I'm flattered and honored. Thanks!

..Or maybe you're taking the piss Wink

I've invested weeks getting it this far with the aid of your forum, the Kixtart board and the Bob Kelly book.

I was actually hoping to make the progressbar segmented so I personally have no issue with the proposed change. When you say that the BorderStyle property is not supported how will it look? Will it still be recessed (3D)?
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sat Nov 05, 2005 9:25 pm    Post subject: Reply with quote

nope, me serious ... this is actually the first substantial script i've seen done in kf.net other then stuff me or benny have done. I know its a tough slog figuring this stuff out, given the sketchy chm and no examples - so hats off to you mate.

The borderstyle of the new pbar will be just like Label with the Fixed3D border - so yeah, i lightly sunken recessed border - the one that looks good (not the chunky textbox style recessed border).
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: Sat Nov 05, 2005 10:01 pm    Post subject: Reply with quote

Hi mercury,

First things first, WOW! very nice. Well done!

It looks as if you have been working very hard on this project, very impresive.

here is you code with a few small adjustments, i could not test it completly because of the dif of domains, but give this a spin you will find the attachment link at the bottom of this post (test.kix):

here is a simplified example of the progressbar:

Code:
Dim $Count

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.Left = 0
$Form1.StartPosition = 0  ;FormStartPosition_Manual
$Form1.Size = $System.Size(608,434) ;(Width,Height)
$Form1.Text = "Form1"
$Form1.Top = 0

$ProgressBar1 = $System.ProgressBar()
$ProgressBar1.Left = 10
$ProgressBar1.Text = "ProgressBar1"
$ProgressBar1.Top = 360
$ProgressBar1.Width = 580
$ProgressBar1.Value = 1
$nul = $Form1.Controls.Add($ProgressBar1)

$Button1 = $System.Button()
$Button1.FlatStyle = 3  ;System
$Button1.Left = 220
$Button1.Text = "Click Me"
$Button1.Top = 310
$Button1.Click = "StepProgressBar()"
$nul = $Form1.Controls.Add($Button1)

$Label1 = $System.Label()
$Label1.BorderStyle = 1  ;FixedSingle
$Label1.Left = 310
$Label1.Text = ""
$Label1.TextAlign = 16  ;MiddleLeft
$Label1.Top = 310
$nul = $Form1.Controls.Add($Label1)

$Form1.Show  ;Displays the Form

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

Function StepProgressBar()
   
   $Button1.enabled = 0
   For $x = 1 to 150
      AdvanceProgressBar(1)
   Next
   $Button1.enabled = -1
   
EndFunction

Function AdvanceProgressBar($Step)
   
   $Count = $Count + $Step
   If $Count > 100
      $Count = 0
   EndIf
   $ProgressBar1.Value = $Count
   $ProgressBar1.Refresh
   $Label1.Text = $Count
   Sleep 0.1
   
EndFunction





test.kix
 Description:

Download
 Filename:  test.kix
 Filesize:  60.04 KB
 Downloaded:  986 Time(s)


_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)


Last edited by benny69 on Sat Nov 05, 2005 10:05 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sat Nov 05, 2005 10:04 pm    Post subject: Reply with quote

The other thing about the new ProgressBar, it will support VisualStyles, you know - that slick-looking greenish colored pbar (look) ... it will fit in with all the other controls that have visual style.
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sat Nov 05, 2005 10:23 pm    Post subject: Reply with quote

merc, here's a screen shot of Benny's script, using the new pbar. Hope its kinda what your looking for ...

Back to top
View user's profile Send private message
mercury
KiXforms Regular
KiXforms Regular


Joined: 10 Aug 2005
Posts: 50

PostPosted: Sat Nov 05, 2005 11:05 pm    Post subject: Reply with quote

Thanks Benny,

I tested your code and saw that the graphical glitch was fixed. I then noticed the $ProgressBar.Refresh method you added and applied this to my original code. Again, no more gaps. The only problem with your function was that the progress bar would not go all the way to the end unless you had 100 items to more.

Your code also got me thinking. Your function resets the counter once it hits 100 (default). Mine only does it after the loop exits. This is fine as I determine the step increments before the loop but if I had to move more than 100 accounts the ProgressBar would complete before the end of the total loop cycles (minimum step value could only be 1) - nothing more annoying than seeing a full ProgressBar and still waiting for the damn process to finish Smile

Therefore I made it so the $ProgressBar.Maximum property value is dynamically changed depending on the selection and always incremented by 1.



Code:
Function UDF_MoveAccounts($Direction)
   
   $ProgressBar.Value = 0
   
   $Confirm = MessageBox("Are you sure you move these accounts?", "Account Move Confirmation",1 , )
            Select
               
                Case $Confirm = 1 ;Yes
                   
                   ;#### Move Accounts ####
                   
                   Select
                   Case $Direction = "Class1toClass2"
                      $CB1 = $ComboBoxClass1
                      $LB1 = $ListBoxClass1
                      $CB2 = $ComboBoxClass2
                      $LB2 = $ListBoxClass2
                   Case $Direction = "Class2toClass1"
                      $CB1 = $ComboBoxClass2
                      $LB1 = $ListBoxClass2
                      $CB2 = $ComboBoxClass1
                      $LB2 = $ListBoxClass1
                   Case 1
                      Return
                   EndSelect
                   
                   $ProgressBar.Maximum = $LB1.SelectedItems.Count
                   ;$ProgressStep = Round(100 /$LB1.SelectedItems.Count ,0)
                      
                   
                   For Each $User In $LB1.SelectedItems
                     $objCommand.CommandText = "<LDAP://OU=Pupils ,DC=" + @Domain + ", DC=com>;
                        (&(objectClass=user)(cn=" + $User + "));AdsPath;Subtree"
                     $objRecordSet = $objCommand.Execute()
                     $usrPath = $objRecordSet.Fields('AdsPath')
                     $adsUser = GetObject($usrPath)
                     
                     ;Remove from Current Class $ComboBoxClass1.Text
                     $CurrentClass = GetObject("LDAP://cn=" + $CB1.Text +
                        " ,OU=Classes, OU=Years, OU=Domain Groups, DC=" + @Domain + ", DC=com")
                     $CurrentClass.Remove($adsUser.ADsPath)                     
                     
                     ;Remove from Current Year $ComboBoxClass1.Text -3
                     $CurrentYear = GetObject("LDAP://cn=" + Left($CB1.Text, 7) +
                        " ,OU=" + $TextBoxAboutSettingsChildGroupOU.Text + " , OU=" +
                           $TextBoxAboutSettingsParentGroupOU.Text + ", DC=" + @Domain + " ,DC=com")
                     $CurrentYear.Remove($adsUser.AdsPath)
                     
                     ;Add to destination Class $ComboBoxClass2.Text                     
                     $DestinationClass = GetObject("LDAP://cn=" + $CB2.Text +
                        " ,OU=" + $TextBoxAboutSettingsSubChildGroupOU.Text + " ,OU=" +
                           $TextBoxAboutSettingsChildGroupOU.Text + " , OU=" + $TextBoxAboutSettingsParentGroupOU.Text +
                              ", DC=" + @Domain + " ,DC=com")
                     $DestinationClass.Add($adsUser.ADsPath)
                                       
                     ;Add to destination Year $ComboBoxClass2.Text -3
                     $DestinationYear = GetObject("LDAP://cn=" + Left($CB2.Text, 7) +
                        " ,OU=" + $TextBoxAboutSettingsChildGroupOU.Text + " , OU=" +
                           $TextBoxAboutSettingsParentGroupOU.Text + ", DC=" + @Domain + " ,DC=com")
                     $DestinationYear.Add($adsUser.AdsPath)
                     
                     ;Move to Destination OU
                     
                     $dy = Left($CB2.Text, 7)
                     
                        If $dy = "Year 01" Or $dy = "Year 02" Or $dy = "Year 03" Or $DestinationYear = "Year 04"
                           $DestinationOU = "OU=Year 1-4, OU=" + $ComboBoxABoutSettingsParentOU.Text
                        EndIf
                           
                        If  $dy = "Year 05" Or $dy = "Year 06"
                           $DestinationOU = "OU=Year 5-6, OU=" + $ComboBoxABoutSettingsParentOU.Text
                        EndIf
                        
                        If $dy = "Year 07" Or $dy = "Year 08" Or $dy = "Year 09"
                           $DestinationOU = "OU=Year 7-9, OU=" + $ComboBoxABoutSettingsParentOU.Text
                        EndIf
                        
                        If $dy = "Year 10" Or $dy = "Year 11"
                           $DestinationOU = "OU=Year 10-11, OU=" + $ComboBoxABoutSettingsParentOU.Text
                        EndIf      
                        
                        $ = $adsUser.SetInfo            
                     
         
                        $objOU = GetObject("LDAP://" + $DestinationOU + ", DC=" + @Domain + ", dc=com")                        
                        $nul = $objOU.MoveHere($adsUser.ADsPath,"cn=" + $adsUser.cn)
                        
                        $ProgressBar.Value = $ProgressBar.Value + 1
                        $ProgressBar.Refresh
                        ;AdvanceProgressBar(1)
                        
                           
                  Next
                   

               Case $Confirm = 2 ;Cancel
               Return

             EndSelect
            
            ;Refresh $ListBoxClass2      
   
            $ = UDF_ListUsers("Class2")
            $ = UDF_ListUsers("Class1")
            $ProgressBar.Value = 0

EndFunction


Last edited by mercury on Sat Nov 05, 2005 11:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
mercury
KiXforms Regular
KiXforms Regular


Joined: 10 Aug 2005
Posts: 50

PostPosted: Sat Nov 05, 2005 11:10 pm    Post subject: Reply with quote

Shawn,

Nice!

When can I have the new build? Cunning
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sat Nov 05, 2005 11:19 pm    Post subject: Reply with quote

Thats one looong list of years you got in that DOB combo-box. Kinda hard to get my mouse around it on my 1024x768 desktop.

btw - new build will prolly be out early next week sometime.
Back to top
View user's profile Send private message
mercury
KiXforms Regular
KiXforms Regular


Joined: 10 Aug 2005
Posts: 50

PostPosted: Sat Nov 05, 2005 11:26 pm    Post subject: Reply with quote

Yep, I'm running 1280x1024 and hate scrolling Smile

1024x768 is the target desktop size so I should change it.
Back to top
View user's profile Send private message
ntdoc
KiXforms Supporter
KiXforms Supporter


Joined: 05 Mar 2003
Posts: 77
Location: Mouse Country

PostPosted: Wed Nov 09, 2005 9:47 am    Post subject: Reply with quote

Not a problem on 1600x1200 for me. But I do wear glasses now days. Sad

Well, must say - nice overall if you've done this without the help of Shawn the Grand Po Ba.

I can't seem to read enough or get off the ground too far with KF without his assistance.

Hats off to you for all the self investigation and discovery.
 
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
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