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

RadioButton groups ?

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


Joined: 28 Jun 2006
Posts: 53
Location: The Netherlands

PostPosted: Thu Nov 01, 2007 7:20 am    Post subject: RadioButton groups ? Reply with quote

Probably a silly question but I couln't find the answer myself.
I want to have 2 sets of radio buttons acting independently for instance:

$RadioButton1.Group = 1
$RadioButton2.Group = 1
$RadioButton3.Group = 2
$RadioButton4.Group = 2

Could anyone help me out on this ?

_________________
Achieve inner peace through outer violence.
Back to top
View user's profile Send private message Visit poster's website
benny69
KiXforms Advocate
KiXforms Advocate


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

PostPosted: Thu Nov 01, 2007 11:56 am    Post subject: Reply with quote

Hey Pal,

Seperate them in a container like a GroupBox or Panel, here is an example using GroupBoxes:

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

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

$GroupBox1 = $System.GroupBox()
$GroupBox1.Left = 10
$GroupBox1.Text = "GroupBox1"
$GroupBox1.Top = 10
$nul = $Form1.Controls.Add($GroupBox1)

$RadioButton1 = $System.RadioButton()
$RadioButton1.CheckChanged = "Group1($$System.Sender)"
$RadioButton1.Checked = -1  ;True
$RadioButton1.Name = "RadioButton1"
$RadioButton1.Left = 10
$RadioButton1.Text = "RadioButton1"
$RadioButton1.Top = 20
$nul = $GroupBox1.Controls.Add($RadioButton1)

$RadioButton2 = $System.RadioButton()
$RadioButton2.CheckChanged = "Group1($$System.Sender)"
$RadioButton2.Name = "RadioButton2"
$RadioButton2.Left = 10
$RadioButton2.Text = "RadioButton2"
$RadioButton2.Top = 60
$nul = $GroupBox1.Controls.Add($RadioButton2)

$GroupBox2 = $System.GroupBox()
$GroupBox2.Left = 10
$GroupBox2.Text = "GroupBox2"
$GroupBox2.Top = 120
$nul = $Form1.Controls.Add($GroupBox2)

$RadioButton3 = $System.RadioButton()
$RadioButton3.CheckChanged = "Group2($$System.Sender)"
$RadioButton3.Name = "RadioButton3"
$RadioButton3.Left = 10
$RadioButton3.Text = "RadioButton3"
$RadioButton3.Top = 20
$nul = $GroupBox2.Controls.Add($RadioButton3)

$RadioButton4 = $System.RadioButton()
$RadioButton4.CheckChanged = "Group2($$System.Sender)"
$RadioButton4.Checked = -1  ;True
$RadioButton4.Name = "RadioButton4"
$RadioButton4.Left = 10
$RadioButton4.Text = "RadioButton4"
$RadioButton4.Top = 60
$nul = $GroupBox2.Controls.Add($RadioButton4)

$TextBox1 = $System.TextBox()
$TextBox1.Left = 250
$TextBox1.Text = "TextBox1"
$TextBox1.Top = 20
$nul = $Form1.Controls.Add($TextBox1)

$TextBox2 = $System.TextBox()
$TextBox2.Left = 250
$TextBox2.Text = "TextBox2"
$TextBox2.Top = 130
$nul = $Form1.Controls.Add($TextBox2)

$Form1.Show  ;Displays the Form

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

Function Group1($Sender)
  Select
    Case $Sender.Name = "RadioButton1"
      $TextBox1.Text = "RadioButton1"
    Case $Sender.Name = "RadioButton2"
      $TextBox1.Text = "RadioButton2"
  EndSelect
EndFunction

Function Group2($Sender)
  Select
    Case $Sender.Name = "RadioButton3"
      $TextBox2.Text = "RadioButton3"
    Case $Sender.Name = "RadioButton4"
      $TextBox2.Text = "RadioButton4"
  EndSelect
EndFunction

_________________
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
apronk
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2006
Posts: 53
Location: The Netherlands

PostPosted: Thu Nov 01, 2007 12:45 pm    Post subject: Reply with quote

Cool, thx bud Smile
_________________
Achieve inner peace through outer violence.
Back to top
View user's profile Send private message Visit poster's website
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