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

Problem with Listview

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


Joined: 05 Mar 2003
Posts: 12
Location: Nederland

PostPosted: Wed May 31, 2006 9:11 am    Post subject: Problem with Listview Reply with quote

When I put data in a combobox I want to check a listbox if the data exists.

if the data which I input exists in the listbox I don't want to get it in the combobox

How can I do that.
Back to top
View user's profile Send private message Send e-mail
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Wed May 31, 2006 9:32 am    Post subject: Reply with quote

Not that simple.
Afaik the .List property of ListBox is a write only property and can't be read.

Only chance you have is to store the Listbox Items in an array of strings and compare the combobox item with ascan().
You should as well fill, and if dynamic overwrite, the Listboxitems with this array. ($listbox.List = $array)

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
benny69
KiXforms Advocate
KiXforms Advocate


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

PostPosted: Wed May 31, 2006 12:42 pm    Post subject: Reply with quote

Hi Darkwin,
You can read the items in a ListBox, here is an example:

Code:

;region Setup Variables
$Version = "Build(1.0.0.1)"
$System = CreateObject("Kixtart.System")
;endregion

Break on
If Not $System
   $= MessageBox("KiXforms Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf

;region Main Form
$Form = $System.Form()
$Form.Height = 400
$Form.Text = "Basic Form $Version"
$Form.Width = 600

$ListBox = $Form.Controls.ListBox()
$ListBox.Left = 20
$ListBox.Top = 20

$ListBox.List = "ListItem 1","ListItem 2","ListItem 3","ListItem 4","ListItem 5"

$ReadListButton = $Form.Controls.Button()
$ReadListButton.Left = 70
$ReadListButton.Text = "Read ListBox"
$ReadListButton.Top = 230
$ReadListButton.OnClick = "ReadListBox()"
$ReadListButton.Width = 100

$Form.Center
$Form.Show()

While $Form.Visible
   $= Execute($Form.DoEvents)
Loop
OnExit()
;endregion

;region Common Functions
Function ReadListBox()
   
   For $x = 0 to $ListBox.ListCount
      If Not($ListBox.List($x) = "")
         $ListItem = $ListBox.List($x)
         ? $ListItem
      EndIf
   Next
   
EndFunction

Function OnExit()
   Quit()
EndFunction
;endregion

_________________
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
Jochen
KiXforms Devotee
KiXforms Devotee


Joined: 05 Mar 2003
Posts: 1204
Location: Stuttgart, Germany

PostPosted: Wed May 31, 2006 1:00 pm    Post subject: Reply with quote

.List(n)

didn't know about that method... Must've been introduced in an inattentive moment Snore

_________________
Jochen

Tell me, and I will forget.
Show me, and I may remember.
Involve me, and I will understand.
Back to top
View user's profile Send private message MSN Messenger
benny69
KiXforms Advocate
KiXforms Advocate


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

PostPosted: Wed May 31, 2006 1:15 pm    Post subject: Reply with quote

Jochen, you da man,
cause you have prolly forgoten more than i even know.
and I thank you for all the support you give on this fourm, you have saved me more times than i can count.

_________________
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
Darkwin
KiXforms Dabbler
KiXforms Dabbler


Joined: 05 Mar 2003
Posts: 12
Location: Nederland

PostPosted: Wed May 31, 2006 6:18 pm    Post subject: Thanks Reply with quote

I have find it.

thans for the sample script
Back to top
View user's profile Send private message Send e-mail
benny69
KiXforms Advocate
KiXforms Advocate


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

PostPosted: Wed May 31, 2006 6:22 pm    Post subject: Reply with quote

Your welcome, glad i could contribute
_________________
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
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