KiXforms.Net Learning Series - Windows Registry Run [Project 01 - Lesson 01]

Next Lessons:
Project 01 - Lesson 02
Project 01 - Lesson 03

  • All scripters are welcome, Beginners to Masters.
  • KiXforms.Net version or newer must be used. To verify your version of KiXforms.Net, use KiXforms.Net Version Checker (found below).
  • Please do not use this series just to bump your post count.
  • Do not post solutions until after solution post time is announced.
  • Collaboration is not allowed until after solution post time is announced.
  • I will post to indicate when solution post time starts.
  • Comments are a must, be descriptive but not excessive.
  • Use descriptive variable names to make it easier for yourself and others to follow what is happening.
  • The only help allowed is:
    • 'KiXforms.chm'
    • 'Kixforms.System.tlb'
    • 'Scripted Resource (Base64) Development Kit'
    • 'KiXforms Designer .NET 2.0 (Beta)'
    • 'The Script Center Script Repository'
    • ' UDF library collection'
  • Note: 'KiXforms.chm' can be found in KiXforms.Zip (KF.NET Development Build)
    'Kixforms.System.tlb' can be found in your System32 directory after the installation of KiXforms.msi (found in '').
    To view 'Kixforms.System.tlb' use iTripoli Type Library Viewer.
    If you choose, you can create a shortcut to the 'iTripoli Type Library Viewer' then, modify the shortcut target to:
    "C:\Program Files\iTripoli\Tools\TypeViewer.exe" Kixforms.System.tlb,
    then the shortcut will automatically open 'Kixforms.System.tlb'.
    Get Scripted Resource (Base64) Development Kit if you want or need it.
    Get KiXforms Designer .NET 2.0 (Beta) if you want or need it.
    Go to The Script Center Script Repository if you want or need to.
    Go to UDF library collection if you want or need to.
    You can also modify UDFs found in ' UDF library collection' if needed but make sure you comment on your changes.
  • All submitted code should be as though it were to be used in production.
    • Code should set options to On.
    • Error checking should be in place where needed.
    • All variables including form and controls should be Dimmed.
    • All UDFs should be self contained and all variables Dimmed.
  • All code should be in code tags.
  • When creating KiXforms the command console is not desired so use 'WKiX32.exe' not 'KiX32.exe'.

KiXforms.Net Version Checker:
;KiXforms.Net Version Checker

;Set Break to On if not in Logon Mode.
If Not @LogonMode
  Break On

;Set Code Options to On
Dim $SO
$SO=SetOption("NoMacrosInStrings", "ON")
$SO=SetOption("NoVarsInStrings", "ON")
$SO=SetOption("Explicit", "ON")

;Setup Variables.
Dim $System,$nul,$MainForm,$ProductVersionLabel,$ProductNameLabel

;Create 'Kixforms.System' Object.
$System = CreateObject("Kixforms.System")

;Verify the 'Kixforms.System' Object was created if not, notify and exit.
If Not $System
  $nul= MessageBox("KiXforms.Net Not Initiated."+@CRLF+
  "Please verify KiXforms.Net is installed."+@CRLF+
  "This Script Will Now Close.","Error",16)

;Create Form and Controls.
$MainForm = $System.Form()
$MainForm.StartPosition = $System.FormStartPosition_CenterScreen
$MainForm.Size = $System.Size(338,83)
$MainForm.Text = "KiXforms.Net Version Checker"

$ProductVersionLabel = $System.Label()
$ProductVersionLabel.Dock = $System.DockStyle_Top
$ProductVersionLabel.Text = "Ver. "+$System.ProductVersion
$ProductVersionLabel.TextAlign = $System.ContentAlignment_MiddleCenter
$nul = $MainForm.Controls.Add($ProductVersionLabel)

$ProductNameLabel = $System.Label()
$ProductNameLabel.Dock = $System.DockStyle_Top
$ProductNameLabel.Text = $System.ProductName
$ProductNameLabel.TextAlign = $System.ContentAlignment_MiddleCenter
$nul = $MainForm.Controls.Add($ProductNameLabel)

;Show the Form

;Loop to catch form events.
While $MainForm.Visible
  $nul = Execute($MainForm.DoEvents())
Exit 0

Objectives for Lesson 01:
  • Create a form script with KiXforms.Net.
  • The majority of Events and Functions will be developed in Lesson 02.

Standard Code Set Options:
;region Set Code Options
;Set Break to On if not in Logon Mode.
If Not @LogonMode
	Break On

;Set Code Options to On
Dim $SO
$SO=SetOption("NoMacrosInStrings", "ON")
$SO=SetOption("NoVarsInStrings", "ON")
$SO=SetOption("Explicit", "ON")
;endregion Set Code Options

  • A user intuitive, sizable form that centers it's self upon startup.
  • The form and it's controls should resize and or adjust as the form is resized.
  • A 'MainMenu' with the following functioning 'MenuItems';
    • File
    • File>Exit
  • The 'File>Exit MenuItem' to exit the form.
  • A 'ComboBox' at the top of the form, used to choose the registry run to look at or alter.
  • A 'ListView' on the top half of the form, that resizes when the form is resized.
  • A 'Splitter' so the height of 'ListView' can be altered.
  • A 'Label' to describe what the bottom 'ListView' is for.
  • A 'ListView' below the 'Label' to show the registry run entries to be deleted.
  • A stack of six 'Buttons' (Control Stack) for the following (Events and Functions to be developed in Lesson 02):
    • 'Save' - to save the changes made to the registry.
    • 'Backup' - to make a backup copy of the current registry.
    • 'Restore' - to restore the registry from the backup.
    • 'Refresh' - to refresh the registry entries in the top 'ListView'.
    • 'Delete' - to delete the registry entries in the lower 'ListView'.
    • 'Exit' - to exit the form.
  • An 'ImageList' for the 'Control Stack'. Each image in the 'ImageList' will be 16x16.
  • The Images should be converted to a Base64 string for implementation in the form.
  • GridLines should be enabled for both 'ListViews'.
  • The form should start with the size 600,400 (Width, Height).
  • The minimum size of the form should not be allowed to be smaller than 600,400 (Width, Height) if it is resized.
  • An icon for the 'Form.Icon'.
  • The 'Form.Icon' should be converted to a Base64 string for implementation in the form. The 'Form.Icon' will be 16x16.

The Form Appearance:


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