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

ComboBox will not trigger onclick (or anything else...)

 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
Radimus
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 157
Location: Tampa, Florida

PostPosted: Thu Jul 23, 2009 7:13 pm    Post subject: ComboBox will not trigger onclick (or anything else...) Reply with quote

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
$nul = $System.Application.EnableVisualStyles

$Form1 = $System.Form()
$Form1.FormBorderStyle = 2  ;FormBorderStyle_Fixed3D
$Form1.StartPosition = 1  ;FormStartPosition_CenterScreen
$Form1.Size = $System.Size(451,421) ;(Width,Height)
$Form1.Text = "Computer Lookup"

$Label1 = $System.Label()
$Label1.Height = 15
$Label1.Left = 15
$Label1.Text = "Office Location"
$Label1.Top = 18
$Label1.Width = 90
$nul = $Form1.Controls.Add($Label1)

$ComboBox1 = $System.ComboBox()
$ComboBox1.Left = 110
$ComboBox1.TabStop = -1  ;True
$ComboBox1.Top = 15
$ComboBox1.Width = 300
$ComboBox1.DropDownWidth = 300
$ComboBox1.Sorted = "True"
$ComboBox1.DropDownStyle = 2
$ComboBox1.OnClick = "FindPCs()"
$ComboBox1.OnTextChanged = "FindPCs()"
$ComboBox1.OnSelectedIndexChanged = "FindPCs()"
$nul = $Form1.Controls.Add($ComboBox1)

......

Function FindPCs()

? 'running'
? $ComboBox1.Text


   $Loc = trim($ComboBox1.Text)
   If $Loc > ' '
...
EndFunction


I can't get any event to trigger the Function FindPCs()

(I'd paste more code, but the bulf og the form is DB connection
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
benny69
KiXforms Advocate
KiXforms Advocate


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

PostPosted: Thu Jul 23, 2009 7:25 pm    Post subject: Reply with quote

Hi Radimus,
KiXforms.Classic uses OnClick events
KiXforms.Net uses Click events
Remove the On and things should work.

_________________
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
Radimus
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 157
Location: Tampa, Florida

PostPosted: Fri Jul 24, 2009 12:53 pm    Post subject: Reply with quote

Yes sir, that did it

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
$nul = $System.Application.EnableVisualStyles

$Form1 = $System.Form()
$Form1.FormBorderStyle = 2  ;FormBorderStyle_Fixed3D
$Form1.StartPosition = 1  ;FormStartPosition_CenterScreen
$Form1.Size = $System.Size(451,421) ;(Width,Height)
$Form1.Text = "Office Computer Lookup"

$Label1 = $System.Label()
$Label1.Height = 15
$Label1.Left = 15
$Label1.Text = "Office Location"
$Label1.Top = 18
$Label1.Width = 90
$nul = $Form1.Controls.Add($Label1)

$ComboBox1 = $System.ComboBox()
$ComboBox1.Left = 110
$ComboBox1.TabStop = -1  ;True
$ComboBox1.Top = 15
$ComboBox1.Width = 300
$ComboBox1.DropDownWidth = 300
$ComboBox1.Sorted = "True"
$ComboBox1.DropDownStyle = 2
[b]$ComboBox1.SelectedIndexChanged[/b] = "FindPCs()"
$nul = $Form1.Controls.Add($ComboBox1)

.....
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic 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