View previous topic :: View next topic |
Author |
Message |
tmartinez KiXforms Follower

Joined: 25 Mar 2004 Posts: 15
|
Posted: Thu Sep 08, 2016 11:10 pm Post subject: Dynamically populate dropdown box with selectable entries |
|
|
Hello all,
I have an AD User Admin tool that I want to enhance. I'd like the kixform to have the ability to dynamically populate a search field as characters are being entered. Specifically, while entering a user name, whether it be a SamAccountName, Last name, DisplayName, ... As the AD Search process finds AD user names that matched the entered characters, multiple lines, 10-20, AD User Names start appearing and/or disappearing in a drop down box. And once the AD user name you have been looking for appears, you can select/click on it to populate the kixForm box/field. Is that doable with KixForms? if so, can someone share the box (combox) code, and/or point me in the right direction?
Thanks  |
|
Back to top |
|
 |
enahsyemotp KiXforms Regular

Joined: 22 Sep 2010 Posts: 40 Location: Tulsa, OK
|
Posted: Tue Sep 27, 2016 10:02 pm Post subject: |
|
|
This should be possible, but I wouldn't recommend it. In essence it would be running the AD query on every keystroke. You could maybe create a list of All objects at the beginning, and then narrow down by keystroke. |
|
Back to top |
|
 |
enahsyemotp KiXforms Regular

Joined: 22 Sep 2010 Posts: 40 Location: Tulsa, OK
|
Posted: Tue Sep 27, 2016 10:48 pm Post subject: |
|
|
Here is a basic example that demonstrates one way to do what you're asking.
Code: | Break On
$list = "abc","abcd","bcd","bcdef"
$Form = CreateObject("Kixtart.Form")
$TextBox = $Form.TextBox
$TextBox.Location = 0,0
$TextBox.OnKeyDown = "Search()"
$ListView = $Form.ListView
$ListView.Location = 10,$TextBox.Bottom+5
$ListView.Columns.Count = 1
$Exit = $Form.ToolButton
$Exit.Center
$Exit.Top = $ListView.Bottom + 5
$Exit.Text = "Exit"
$Exit.Icon = 37
$Exit.OnClick = "Quit()"
LoadList()
$Form.Center
$Form.Show
While $Form.Visible
$=Execute($Form.DoEvents)
Loop
Exit 1
Function Search()
For Each $item in $ListView.Items
If Left($item.Text, Len($TextBox.Text)) <> $TextBox.Text
$item.Remove()
Endif
Next
EndFunction
Function LoadList()
For Each $item in $list
$nul = $ListView.Items.Add($item)
Next
EndFunction |
|
|
Back to top |
|
 |
tmartinez KiXforms Follower

Joined: 25 Mar 2004 Posts: 15
|
Posted: Wed Sep 28, 2016 1:12 am Post subject: Post subject: Dynamically populate dropdown box with selecta |
|
|
enahsyemotp from -Tulsa, OK-
thank you.
I'll play w/ the code. |
|
Back to top |
|
 |
|