SDBUIRadioButton: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{AutomationObjectsList}}
== CoClass SDBUIRadioButton ==
== CoClass SDBUIRadioButton ==


Radio button (UI element).
Radio button (UI element).


===Example Code===
From a post by DiddeLeeDoo
[[Image:Radiobuttons.png]]
<source lang="vb">
Set SDB=CreateObject("SongsDB.SDBApplication")
'Make a Form frame
Set Frm=SDB.UI.NewForm
    Frm.Common.SetRect 0,0,220,160
'---------------------
'RADIO STATION 1
Set Pnl=SDB.UI.NewTranspPanel(Frm)
    Pnl.Common.SetRect 10,10,100,100
    Pnl.Common.ControlName="RadioStation1"
'RadioButtons for Station 1
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,10,60,20
    Rad.Caption="Station 1"
    Rad.Checked=True
    Rad.Common.ControlName="R01"
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,30,60,20
    Rad.Caption="Station 2"
    Rad.Checked=False
    Rad.Common.ControlName="R02"
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,50,60,20
    Rad.Caption="Station 3"
    Rad.Checked=False
    Rad.Common.ControlName="R03"
'------------- 
'RADIO STATION 2
Set Pnl=SDB.UI.NewTranspPanel(Frm)
    Pnl.Common.SetRect 110,10,100,100
    Pnl.Common.ControlName="RadioStation2"
'RadioButtons for Station 2
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,10,60,20
    Rad.Caption="Station 1"
    Rad.Checked=True
    Rad.Common.ControlName="R01"
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,30,60,20
    Rad.Caption="Station 2"
    Rad.Checked=False
    Rad.Common.ControlName="R02"
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,50,60,20
    Rad.Caption="Station 3"
    Rad.Checked=False
    Rad.Common.ControlName="R03"
 
'Show form
Frm.ShowModal
'Read values from the form.
If Frm.Common.ChildControl("RadioStation1").Common.ChildControl("R01").Checked Then Station1=1
If Frm.Common.ChildControl("RadioStation1").Common.ChildControl("R02").Checked Then Station1=2
If Frm.Common.ChildControl("RadioStation1").Common.ChildControl("R03").checked Then Station1=3
If Frm.Common.ChildControl("RadioStation2").Common.ChildControl("R01").Checked Then Station2=1
If Frm.Common.ChildControl("RadioStation2").Common.ChildControl("R02").Checked Then Station2=2
If Frm.Common.ChildControl("RadioStation2").Common.ChildControl("R03").checked Then Station2=3
'tell what you selected after closing the form
MsgBox Station1 & vbLf & Station2
</source>
=== ISDBUIRadioButton members ===
=== ISDBUIRadioButton members ===
    
    

Latest revision as of 07:23, 5 May 2008

CoClass SDBUIRadioButton

Radio button (UI element).

Example Code

From a post by DiddeLeeDoo

Set SDB=CreateObject("SongsDB.SDBApplication")

'Make a Form frame
Set Frm=SDB.UI.NewForm
    Frm.Common.SetRect 0,0,220,160


'---------------------
'RADIO STATION 1
Set Pnl=SDB.UI.NewTranspPanel(Frm)
    Pnl.Common.SetRect 10,10,100,100
    Pnl.Common.ControlName="RadioStation1"

'RadioButtons for Station 1
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,10,60,20
    Rad.Caption="Station 1"
    Rad.Checked=True
    Rad.Common.ControlName="R01"
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,30,60,20
    Rad.Caption="Station 2"
    Rad.Checked=False
    Rad.Common.ControlName="R02"
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,50,60,20
    Rad.Caption="Station 3"
    Rad.Checked=False
    Rad.Common.ControlName="R03"

'-------------   
'RADIO STATION 2
Set Pnl=SDB.UI.NewTranspPanel(Frm)
    Pnl.Common.SetRect 110,10,100,100
    Pnl.Common.ControlName="RadioStation2"

'RadioButtons for Station 2
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,10,60,20
    Rad.Caption="Station 1"
    Rad.Checked=True
    Rad.Common.ControlName="R01"
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,30,60,20
    Rad.Caption="Station 2"
    Rad.Checked=False
    Rad.Common.ControlName="R02"
Set Rad=SDB.UI.NewRadioButton(Pnl)
    Rad.Common.SetRect 10,50,60,20
    Rad.Caption="Station 3"
    Rad.Checked=False
    Rad.Common.ControlName="R03"
   
'Show form
Frm.ShowModal

'Read values from the form.
If Frm.Common.ChildControl("RadioStation1").Common.ChildControl("R01").Checked Then Station1=1
If Frm.Common.ChildControl("RadioStation1").Common.ChildControl("R02").Checked Then Station1=2
If Frm.Common.ChildControl("RadioStation1").Common.ChildControl("R03").checked Then Station1=3

If Frm.Common.ChildControl("RadioStation2").Common.ChildControl("R01").Checked Then Station2=1
If Frm.Common.ChildControl("RadioStation2").Common.ChildControl("R02").Checked Then Station2=2
If Frm.Common.ChildControl("RadioStation2").Common.ChildControl("R03").checked Then Station2=3

'tell what you selected after closing the form
MsgBox Station1 & vbLf & Station2

ISDBUIRadioButton members

Name Type Description
Caption Property Get/Let
Checked Property Get/Let
Common Property Get