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

Trying to understand .net (select multiple checkboxes)

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


Joined: 24 Feb 2009
Posts: 4
Location: Friesland (The Netherlands)

PostPosted: Tue Dec 15, 2009 3:26 pm    Post subject: Trying to understand .net (select multiple checkboxes) Reply with quote

Hello People,

I'm currently working on a software menu tool. The original script (kixform 2x) is working great. So I throught lets fool around with kixforms.net.

Now when I run the script the function "Select all" does not work.

I'm just trying to understand, so maybe someone would like to look into this.

Greets,

WJP


Code:

Break On
debug 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.BackColor = $System.Color.FromName("HighlightText")
$Form1.Left = -4
$Form1.StartPosition = 0  ;FormStartPosition_Manual
$Form1.Size = $System.Size(866,729) ;(Width,Height)
$Form1.Text = "Oke Pc Software Menu"
$Form1.Top = -4
;$Form1.WindowState = 2  ;FormWindowState_Maximized

;***********************Variabelen*********************************
;******************************************************************

;hwinfo
$util1 = ".\exe\hwinfo\hwinfo.exe"
$util1name = "HWinfo"


;7zip
$App1   = $shellcmd + "\autoit\7zipauto.exe"
$App1Name = "7zip"

;adobe 9.1
$App2   = $shellcmd + "\autoit\adobereaderauto.exe"
$App2Name = "Adobe Reader 9.1"

;***********************Einde Variabelen*********************************
;*****************************************************************

;************* PictureBox1 **************
$PictureBox1 = $System.PictureBox()
$PictureBox1.BackColor = $System.Color.FromName("HighlightText")
$PictureBox1.BorderStyle = 1  ;FixedSingle
$PictureBox1.Height = 110
$PictureBox1.Left = 200
$PictureBox1.Top = 410
$PictureBox1.Width = 464
$PictureBox1.Image = $System.Bitmap("c:\test\bin\oke.bmp")
$nul = $Form1.Controls.Add($PictureBox2)
;**************************************


;*************TABCONTROL*************************

$TabControl1 = $System.TabControl()
$TabControl1.Height = 360
$TabControl1.Left = 50
$TabControl1.Top = 10
$TabControl1.Width = 770
$nul = $Form1.Controls.Add($TabControl1)

$TabPage1 = $System.TabPage()
$TabPage1.Text = "TabPage1"
$nul = $TabControl1.Controls.Add($TabPage1)
;*************TABCONTROL*************************

;****************************************************************************************
;*                                                                  *
;*                        Knoppen Tabpage 2                              *
;*                                                                  *
;****************************************************************************************

$Button2 = $System.Button()
$Button2.BackColor = $System.Color.FromName("RoyalBlue")
$Button2.Left = 15
$Button2.Text = "Hwinfo"
$Button2.Top = 30
$Button2.Click = "Hwinfo"
$nul = $TabPage2.Controls.Add($Button2)

$Button1 = $System.Button()
$Button1.BackColor = $System.Color.FromName("HighlightText")
$Button1.Height = 23
$Button1.Left = 15
$Button1.Text = "Selecteer alle applicaties"
$Button1.Top = 450
$Button1.Width = 75
$Button1.Click = "SelectAll"
$nul = $Form1.Controls.Add($Button1)

$Button9 = $System.Button()
$Button9.BackColor = $System.Color.FromName("HighlightText")
$Button9.Height = 75
$Button9.Left = 15
$Button9.Text = "GO!"
$Button9.Top = 350
$Button9.Width = 75
$Button9.Click = "RunApps"
$nul = $Form1.Controls.Add($Button9)



;CHECKBOX

$CheckBox1 = $System.CheckBox()
$CheckBox1.Height = 20
$CheckBox1.Width = 138
$CheckBox1.Left = 100
$CheckBox1.Text = "7ZIP"
$CheckBox1.Top = 50
$nul = $TabPage1.Controls.Add($CheckBox1)

$CheckBox2 = $System.CheckBox()
$CheckBox2.Height = 20
$CheckBox2.Width = 138
$CheckBox2.Left = 100
$CheckBox2.Text = "Adobe Reader 9.2"
$CheckBox2.Top = 80
$nul = $TabPage1.Controls.Add($CheckBox2)

;EINDE CHECKBOX

$TabPage2 = $System.TabPage()
$TabPage2.BackColor = $System.Color.FromName("RoyalBlue")
$TabPage2.Text = "TabPage2"
$nul = $TabControl1.Controls.Add($TabPage2)



$Button3 = $System.Button()
$Button3.BackColor = $System.Color.FromName("RoyalBlue")
$Button3.Left = 40
$Button3.Text = "Button2"
$Button3.Top = 20
$nul = $TabPage2.Controls.Add($Button2)

$ProgressBar1 = $System.ProgressBar()
$ProgressBar1.BackColor = $System.Color.FromName("HighlightText")
$ProgressBar1.Left = 230
$ProgressBar1.Text = ""
$ProgressBar1.Top = 570
$ProgressBar1.Width = 450
$ProgressBar1.Value = 0
$nul = $Form1.Controls.Add($ProgressBar1)

$PictureBox2 = $System.PictureBox()
$PictureBox2.BackColor = $System.Color.FromName("HighlightText")
$PictureBox2.BorderStyle = 1  ;FixedSingle
$PictureBox2.Height = 110
$PictureBox2.Left = 290
$PictureBox2.Top = 410
$PictureBox2.Width = 300
$nul = $Form1.Controls.Add($PictureBox2)

$Form1.AcceptButton = $Button1
$Form1.Show  ;Displays the Form

Function SelectAll()
For $C = 1 to 2
$ = Execute("$CheckBox"+$C+".checked = 'True'")
Next
EndFunction

Function RunApps ()
If $CheckBox1.CheckState = 1
Shell ("$App1")
endif
 
If $CheckBox2.CheckState = 1
Shell ("$App2")
EndIf     
endfunction



function Hwinfo ()
Shell ("$util1")
EndFunction

While $Form1.Visible
   $Nul = Execute($Form1.DoEvents())
Loop
Exit 0
Back to top
View user's profile Send private message
BoForce
KiXforms Novice
KiXforms Novice


Joined: 24 Nov 2009
Posts: 2
Location: Leeuwarden, The Netherlands

PostPosted: Tue Dec 15, 2009 10:02 pm    Post subject: Reply with quote

Hello wjp79,

When you change the code
Code:

Function SelectAll()
For $C = 1 to 2
$ = Execute("$CheckBox"+$C+".checked = 'True'")
Next
EndFunction


into
Code:

Function SelectAll()
For Each $Control in $TabControl1.SelectedTab.Controls
   ? $Control.Checked = -1
Next
EndFunction


You will notice that all CheckBoxes will be checked within the selected TabPage.
Would that work for you?
Back to top
View user's profile Send private message
wjp79
KiXforms Novice
KiXforms Novice


Joined: 24 Feb 2009
Posts: 4
Location: Friesland (The Netherlands)

PostPosted: Wed Dec 16, 2009 8:03 am    Post subject: It worked!! :-) Reply with quote

you are brilliant..


Thank you.. Laughing
Back to top
View user's profile Send private message
BoForce
KiXforms Novice
KiXforms Novice


Joined: 24 Nov 2009
Posts: 2
Location: Leeuwarden, The Netherlands

PostPosted: Wed Dec 16, 2009 9:14 pm    Post subject: Reply with quote

Glad I could help. Wink
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