Page 1 of 1 1
Topic Options
#144394 - 2005-07-27 04:43 PM Form with Action Button
Rooster10 Offline
Fresh Scripter

Registered: 2004-10-14
Posts: 14
Hi,

I am trying to create a form in Kix, that when you enter some information and click GO (for example) it launches a other application.. so I really just need a small script with a action button, can someone help?

Top
#144395 - 2005-07-27 04:55 PM Re: Form with Action Button
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
take a lookie at kixforms ( www.kixforms.org )
_________________________
!

download KiXnet

Top
#144396 - 2005-07-27 05:01 PM Re: Form with Action Button
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
or
XlsInputBox() - Displays a dialog box for user input (using excel)
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144397 - 2005-07-27 05:22 PM Re: Form with Action Button
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
This might get you started.
Got some spare time so did a small example hope it helps.
This requires kixform from www.kixforms.org

Code:

Break On
$System = CreateObject("Kixtart.System")

;create form
$Form = $System.Form()
$Form.BackColor = 212,208,200
$Form.FontSize = 8,25
$Form.Height = 187
$Form.Left = 225
$Form.Text = "example"
$Form.Top = 110
$Form.Width = 187

;create pulldown menu
$ComboBox = $Form.Controls.ComboBox()
$ComboBox.DropDownWidth = 121
$ComboBox.FontSize = 8,25
$ComboBox.Height = 21
$ComboBox.Left = 30
$ComboBox.Sorted = "False"
$ComboBox.Text = "Select app to start"
$ComboBox.Top = 30
$ComboBox.Width = 121
$ComboBox.AddItem ("Notepad")
$ComboBox.AddItem ("Int. expl.")

;create button
$Button = $Form.Controls.Button()
$Button.FontSize = 8,25
$Button.Height = 28
$Button.Left = 30
$Button.Text = "Start selected app"
$Button.Top = 75
$Button.Width = 110
$Button.OnClick = "Button_Click()"

$Form.Show
While $Form.Visible
$=Execute($Form.DoEvents())
Loop
Exit 1

Function Button_Click()
$app = $comboBox.text
Select
Case $app = "Select app to start"
$rc = MessageBox("No app selected.","Error",16,0)
Case $app = "Notepad"
Shell "notepad.exe"
Case $app = "Int. expl."
Shell "iexplore.exe"
EndSelect
EndFunction



Edited by Mart (2005-07-27 05:23 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#144398 - 2005-07-27 06:57 PM Re: Form with Action Button
Rooster10 Offline
Fresh Scripter

Registered: 2004-10-14
Posts: 14
Many thanks for that, I am taking the form now and expanding... cheers

Once i have launched the app, can I put a "sendkey" command after the launch to populate a login for example??

Cheers

Dan

Top
#144399 - 2005-07-27 07:29 PM Re: Form with Action Button
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Don't see why not. If you can think of it and how to code it or locate a UDF already written for what you want to do, there isn't too much you can't do with KiXtart and KiXforms.
 

Top
#144400 - 2005-07-28 03:08 PM Re: Form with Action Button
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Example from the 4.50 manual:

Quote:


Code:

Run( "Notepad.exe" )
Sleep 1
SetFocus( "Untitled - Notepad" )
$ReturnCode = SendKeys("Hello World")
Sleep( 2 )
$ReturnCode = SendKeys("~{F4}Y")





_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.056 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org