Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function OnStartup
- {
- $SDB = New-Object -ComObject SongsDB.SDBApplication
- $UI = New-Object -ComObject SongsDB.SDBUI
- $SDBSCRIPT = New-Object -ComObject SongsDB.SDBScriptControl
- #Create the window to be shown
- $Form = $UI.NewForm
- $Form.FormPosition = 4
- $Form.Caption = "Test Change labels"
- $Lbl2 = $UI.NewLabel($Form)
- $Lbl2.Common.ControlName = "Lbl2"
- $Lbl2.Common.SetRect(10, 10, 100, 16)
- $Lbl2.Caption = "Change This Label"
- $SDB.Objects("MyLbl2") = $Lbl2
- $Btn2 = $UI.NewButton($Form)
- $Btn2.Common.ControlName = "Btn2"
- $Btn2.Common.SetRect(10,40,80,25)
- $Btn2.Caption = "Test"
- $SDBSCRIPT.Script.RegisterEvent = $Btn2.OnClick("Btn2Click")
- $Form.ShowModal()
- }
- Function Btn2Click
- {
- $label2 = $SDB.Objects("MyLbl2")
- $label2.Caption = "Label Changed"
- $SDB.MessageBox("Clicked Button",2,(4))
- # add code to change Caption of Lbl2
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement