#109943 - 2003-12-09 07:24 PM
Kixforms
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Ive a kixforms question, how would I add an exit button to the following? Code:
SETCONSOLE("HIDE") CLS if @inwin = "1" shell "%COMSPEC% /c %WINDIR%\System32\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll" else shell "%COMSPEC% /c %WINDIR%\System\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll" endif
break on
$Form = createobject("KiXtart.Form") $Form.Size = 400,200 $Form.Center $Form.Caption="Christmas Message" $Form.BackColor = 255,0,0 $Form.Fontsize = 8 $Form.Fontbold = 1 $Form.Show $Form.Visable = 1
$Multi = $Form.TextBox("",55,30,190,100) $Multi.MultiLine = True $Multi.Scrollbars = 0 $Multi.ForeColor = 25,115,9 $Multi.caption = "Hi, " + @fullname + "." + @crlf + @crlf + "The ICT department wish you a " + @crlf + "very Merry Christmas and a " + @crlf + "Happy New Year! :-)" + @crlf
$Image = $Form.Image("\\tom\netlogon\santa.bmp",270,30,60,67)
Play File "\\harry\netlogon\chris.wav"
While $Form.Visible $=Execute($Form.DoEvents()) Loop
Exit 1
Thanks
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
#109944 - 2003-12-09 07:50 PM
Re: Kixforms
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Generally something like this
$Form.Hide
There are plenty of examples on the KiXforms Website though.
Also, don't forget a user needs to have at least PowerUser rights to register the DLL
KiXforms Website http://www.kixforms.com
|
|
Top
|
|
|
|
#109945 - 2003-12-09 07:51 PM
Re: Kixforms
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Just a couple things...I REM'd out the first two lines to prevent the black console box from popping up for a second. If you are using Kix32.exe and not WKix32.exe then you may want the un-REM those lines.
I also change the $Form.Visable to $Form.Visible and moved both the $Form.Visible and $Form.Show down after the form is completed. This will prevent half of the form from showing while the other half is still loading.
Code:
;SETCONSOLE("HIDE")
;CLS
if @inwin = "1"
shell "%COMSPEC% /c %WINDIR%\System32\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll"
else
shell "%COMSPEC% /c %WINDIR%\System\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll"
endif
break on
$Form = createobject("KiXtart.Form")
$Form.Size = 400,200
$Form.Center
$Form.Caption="Christmas Message"
$Form.BackColor = 255,0,0
$Form.Fontsize = 8
$Form.Fontbold = 1
$Multi = $Form.TextBox("",55,30,190,100)
$Multi.MultiLine = True
$Multi.Scrollbars = 0
$Multi.ForeColor = 25,115,9
$Multi.caption = "Hi, " + @fullname + "." + @crlf + @crlf
+ "The ICT department wish you a " + @crlf + "very Merry Christmas and a " + @crlf
+ "Happy New Year! :-)" + @crlf
$Image = $Form.Image("\\tom\netlogon\santa.bmp",270,30,60,67)
$ExitButton = $Form.Controls.ToolButton("Exit",150,$Multi.Bottom+5)
$ExitButton.ForeColor = 25,115,9
$ExitButton.OnClick = "Quit()"
Play File "\\harry\netlogon\chris.wav"
$Form.Visible = 1
$Form.Show
While $Form.Visible
$=Execute($Form.DoEvents())
Loop
Exit 1
Edited by CitrixMan (2003-12-09 07:54 PM)
|
|
Top
|
|
|
|
#109947 - 2003-12-10 01:11 PM
Re: Kixforms
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
CitrixMan, ive tried using your suggestion but the form just flashes briefly with out the button..
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
|
Top
|
|
|
|
#109950 - 2003-12-10 04:55 PM
Re: Kixforms
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Try this instead...Maybe someone else knows...But Im not sure if the script waits for the Play command to complete before proceeding or not. I moved the $Form.Show above the Play command...Maybe that will have some effect.
Code:
if @inwin = "1" shell "%COMSPEC% /c %WINDIR%\System32\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll" else shell "%COMSPEC% /c %WINDIR%\System\Regsvr32 /s %WINDIR%\SYSTEM\KiXFORMS.dll" endif
break on
$Form = createobject("KiXtart.Form") $Form.Size = 400,200 $Form.Center $Form.Caption="Christmas Message" $Form.BackColor = 255,0,0 $Form.Fontsize = 8 $Form.Fontbold = 1
$Multi = $Form.TextBox("",55,30,190,100) $Multi.MultiLine = True $Multi.Scrollbars = 0 $Multi.ForeColor = 25,115,9 $Multi.caption = "Hi, " + @fullname + "." + @crlf + @crlf + "The ICT department wish you a " + @crlf + "very Merry Christmas and a " + @crlf + "Happy New Year! :-)" + @crlf
$Image = $Form.Image("\\tom\netlogon\santa.bmp",270,30,60,67)
$ExitButton = $Form.Controls.ToolButton("Exit",150,$Multi.Bottom+5) $ExitButton.ForeColor = 25,115,9 $ExitButton.OnClick = "Quit()"
$Form.Visible = 1 $Form.Show
Play File "\\harry\netlogon\chris.wav"
While $Form.Visible $=Execute($Form.DoEvents()) Loop
Exit 1
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1636 anonymous users online.
|
|
|