#197585 - 2010-01-29 11:26 PM
My ComboBoxes are killing me...
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
;~~< OCComboBox >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim $OCComboBox
$OCComboBox = $Panel1.Controls.ComboBox()
$OCComboBox.Size = 173, 21
$OCComboBox.SelectedIndex = -1
$OCComboBox.Location = 496, 35
...
$cmdtxt = "select distinct OrgCode from dbo.SDEUserData"
$cmd.commandtext = $cmdtxt $rs.open($cmd)
$rs.MoveFirst
While Not $rs.eof
$OC = Trim($rs.fields.item("OrgCode").value)
If $oc > ''
$OCComboBox.Items.Add($oc)
EndIf
$rs.moveNext
Loop
$rs.close
$cn.close
The ComboBox REFUSES to add the items, even though I copied the code from another working script... the output goes to the console instead (I have tried just dumping a dumb value and the same thing happens, so it isn't the data (I assume).
I have 2 and they both do the same thing
|
|
Top
|
|
|
|
#197587 - 2010-01-30 03:56 AM
Re: My ComboBoxes are killing me...
[Re: Glenn Barnas]
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Originally they were dim'ed, then I globalled them, then I moved them into the same code block... same results.
I'll try them in a seperate script just to see if I'm losing my mind (even more)
I'd paste the whole script but all the form objects would be cumbersome and it reads from a sql DB so it wouldn't work for anyone else regardless.
|
|
Top
|
|
|
|
#197588 - 2010-01-30 10:39 AM
Re: My ComboBoxes are killing me...
[Re: Radimus]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
Rad, in my scripts I do this:
$=$OCComboBox.Items.Add($oc)
Because else I also get the output to console. But this works for me.
|
|
Top
|
|
|
|
#197590 - 2010-01-30 02:39 PM
Re: My ComboBoxes are killing me...
[Re: Glenn Barnas]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
Glenn, Rad's code is for KixForms .Net. If not, then thats the reason it doesn't work for him
|
|
Top
|
|
|
|
#197591 - 2010-01-30 04:15 PM
Re: My ComboBoxes are killing me...
[Re: Arend_]
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Still doesn't work... Gets the screen output
;~~< Form1 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim $Form1
$Form1 = $System.Form()
$Form1.Size = 407, 395
$Form1.Text = "Form1"
;~~< ComboBox1 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim $ComboBox1
$ComboBox1 = $Form1.Controls.ComboBox()
$ComboBox1.Size = 121, 21
$ComboBox1.SelectedIndex = -1
For $a = 1 to 10
$ = $Combobox1.items.add($a)
Next
$Form1.Show
While $Form1.Visible
$=Execute($System.Application.DoEvents)
Loop
|
|
Top
|
|
|
|
#197592 - 2010-01-30 04:22 PM
Re: My ComboBoxes are killing me...
[Re: Radimus]
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
if I do Additem, it works...
$System = CreateObject("KiXtart.System")
(dammit, 3 hours on this and it was something stupid)
|
|
Top
|
|
|
|
#197593 - 2010-01-31 09:32 AM
Re: My ComboBoxes are killing me...
[Re: Radimus]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
So it was actually "My KiXforms versions are killing me..."
|
|
Top
|
|
|
|
#197594 - 2010-01-31 02:54 PM
Re: My ComboBoxes are killing me...
[Re: Arend_]
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I had assumed that ASE was doing KF.NET...
That is what I get for ASSUMING
|
|
Top
|
|
|
|
#197597 - 2010-02-01 09:42 AM
Re: My ComboBoxes are killing me...
[Re: Radimus]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
For KiXforms.Net I'd suggest to use Benny's KiXforms Designer .Net. It's free and the best design studio for KiXforms .Net
|
|
Top
|
|
|
|
#197607 - 2010-02-01 11:29 PM
Re: My ComboBoxes are killing me...
[Re: Arend_]
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
ok... another issue that refuses to work..
;~~< ListView3 >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Global $ListView3
$ListView3 = $Panel4.Controls.ListView()
$ListView3.Size = 873, 396
$ListView3.View = 1
;~~< ListView3.Columns >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ColCheckBox = $ListView3.Columns.Add
$ColCurrentUser = $ListView3.Columns.Add
$ColCurrentUser.Width = 112
$ColCurrentUser.Text = "Current User"
$ColSerno = $ListView3.Columns.Add
$ColSerno.Width = 115
$ColSerno.Text = "SerialNumber"
$ColModel = $ListView3.Columns.Add
$ColModel.Width = 138
$ColModel.Text = "Model"
$ColAssigned = $ListView3.Columns.Add
$ColAssigned.Width = 115
$ColAssigned.Text = "Assigned To"
$ColOrgCode = $ListView3.Columns.Add
$ColOrgCode.Width = 114
$ColOrgCode.Text = "Assigned OrgCode"
$CoLocation = $ListView3.Columns.Add
$CoLocation.Width = 124
$CoLocation.Text = "Equipment Location"
$ColInvDate = $ListView3.Columns.Add
$ColInvDate.Width = 101
$ColInvDate.Text = "InvDate"
$ListView3.Text = "ListView3"
$ListView3.Location = 0, 0
$ListView3.GridLines = -1
$ListView3.FullRowSelect = -1
$ListView3.CheckBoxes = -1
$ListView3.Dock = 5
...
$count = $ListView3.SelectedItems.Count
For Each $item in $ListView3.SelectedItems
;$test = $items.SubItems(1).Text
$test = $items.SubItems.item(1).Text
Next
the commented out line will crash if I try using it The second line "works" but returns nothing
|
|
Top
|
|
|
|
#197615 - 2010-02-02 01:22 PM
Re: My ComboBoxes are killing me...
[Re: Radimus]
|
Arend_
MM club member
   
Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
|
For Each $Item in $ListView3.SelectedItems
$test = $Item.SubItems(0).Text
$=Form1.MsgBox($test,"")
Next
Should work for KiXforms Classic. Just tested with my own Form.
The 2nd line is for KiXforms .Net. Which version of KiXforms Classic are you using ?
|
|
Top
|
|
|
|
#197657 - 2010-02-03 10:07 PM
Re: My ComboBoxes are killing me...
[Re: Arend_]
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
ok, next one.. 
How you lengthen the dropdown on a combobox?
Global $ComboBox4 $ComboBox4 = $Panel2.Controls.ComboBox() $ComboBox4.Size = 121, 21 $ComboBox4.SelectedIndex = -1 $ComboBox4.Location = 162, 37 $ComboBox4.Sorted = -1 $ComboBox4.DropDownStyle = 2 $ComboBox4.DropDownWidth = 120
It only shows about 5 selections, I'd like about 6-10 (there are 20+ items in the list)
|
|
Top
|
|
|
|
#197660 - 2010-02-04 12:09 AM
Re: My ComboBoxes are killing me...
[Re: Radimus]
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4562
Loc: USA
|
Where's Shawn and Benny when you need em?
|
|
Top
|
|
|
|
#197674 - 2010-02-04 04:12 PM
Re: My ComboBoxes are killing me...
[Re: Mart]
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
So did I, I'm using ASE to build it and by the time I noticed it was in classic it was too much to rebuild it
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|