Page 1 of 1 1
Topic Options
#89099 - 2002-10-31 11:16 AM Kixforms - Listbox Bug
punkie Offline
Getting the hang of it

Registered: 2002-06-23
Posts: 67
When you click on an item in a listbox it refuses to change the colour of the label even if it's set. Looks like a bug to me - it works however with a textbox.

code:
$listbox = $form.ListBox("")
$listbox.Size=110,255
$listbox.Location=15,80
$listbox.BorderStyle=1

$listbox.AddItem("My Item")
$listbox.OnClick = "Display()"

function Display()
$text = $form.Label("This my item",140,80,200,16)
$text.BackColor = 255,255,255
endfunction


Top
#89100 - 2002-10-31 11:51 AM Re: Kixforms - Listbox Bug
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
punkie,

no buggy boo , does this fit yer needs :

code:
 break on cls

$form = createobject("Kixtart.form")

$listbox = $form.ListBox("")
$listbox.Size=110,255
$listbox.Location=15,80
$listbox.BorderStyle=1
$ListBox.default = 1

$listbox.AddItem("My Item")
$ListBox.AddItem("My next Item")
$listbox.OnClick = "ShowItem($$listbox.List($$Listbox.ListIndex))"

$text = $form.Label($Item,140,80,200,16)
$text.BackColor = 255,255,255

$form.show

while $Form.visible
$= execute($Form.DoEvents())
loop

quit()

function ShowItem($item)
$Text.Caption = $item
endfunction

Jochen
_________________________



Top
#89101 - 2002-10-31 11:53 AM Re: Kixforms - Listbox Bug
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Btw.

You can't use DISPLAY() as a function name because it's already a Kixtart command [Wink]
_________________________



Top
#89102 - 2002-10-31 11:59 AM Re: Kixforms - Listbox Bug
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Yet another hint :

to fill a Listbox on the fly you can also use this :

code:
$ListBox.List = "Item 1","Item 2","Item 3"

hth

Jochen
_________________________



Top
#89103 - 2002-11-01 12:10 AM Re: Kixforms - Listbox Bug
punkie Offline
Getting the hang of it

Registered: 2002-06-23
Posts: 67
I saw a bug in my code! forgot to call the label before the function so it only changed colour when you clicked on the item twice.

I just used the Display() thing as an example tho.
Thanks for the assistance [Smile]

Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 301 anonymous users online.
Newest Members
Praveer, Ollero, rayyo, Foxlicht, DonChild
17742 Registered Users

Generated in 0.074 seconds in which 0.056 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