PDA

View Full Version : .Net textBox AutoCompleteMode (help)


SECC0
03-24-2009, 04:22 PM
Hi.
I want to create rollout with 2 elements - textBox and Listbox with AutoComplete.
But I don't know how to use AutoComplete property :banghead:
Here's an example, but it's don't use autoComplete..
My question is : Can I use autoComplete in this case?

Thanks.
Sorry for my english.


(
ArrMod = for n in GeometryClass.classes where n.creatable collect n as string
rollout roll_type "" width:131 height:229
(
dotNetControl edt5 "System.Windows.Forms.TextBox" pos:[5,4] width:122 height:20
dotNetControl listMatch "System.Windows.Forms.listBox" pos:[5,30] width:122 height:200

on edt5 TextChanged txt do
(
ArrList = #()
for i in ArrMod do
(
if matchPattern i pattern: (edt5.text +"*") == true then appendIfUnique ArrList i \
else listMatch.items.clear()
)
sort ArrList
roll_type.listMatch.items.AddRange ArrList
)

on roll_type open do
(
for i = 1 to ArrMod.count do ArrMod[i][1] = toUpper ArrMod[i][1]
roll_type.listMatch.items.AddRange (sort ArrMod)
)
)
createdialog roll_type
setfocus roll_type.edt5
)

ZeBoxx2
03-24-2009, 08:17 PM
short: yes
long:

on roll_type open do
(
edt5.AutoCompleteMode = roll_type.edt5.AutoCompleteMode.SuggestAppend
edt5.AutoCompleteSource = roll_type.edt5.AutoCompleteSource.CustomSource

for i = 1 to ArrMod.count do ArrMod[i][1] = toUpper ArrMod[i][1]
ArrMod = sort ArrMod

listMatch.items.AddRange ArrMod
edt5.AutoCompleteCustomSource.AddRange ArrMod
)

SECC0
03-24-2009, 08:47 PM
:bounce:

Thanks!
Very simple and very cool :applause:

ZeBoxx2
03-24-2009, 09:38 PM
simpler still might be to use a combobox, as that's basically what you're replicating :) ( though you'd still have to set up the autocomplete source, etc. )

SECC0
03-24-2009, 09:58 PM
Yes, you're right.. thanks again :thumbsup:

SECC0
03-28-2009, 12:38 AM
How can I increase the autocomplete list height? It's too small by default..
I've read .net help on microsoft site :deal: , but I'm not shure which property I have to use in this case..

Thanks

ZeBoxx2
03-28-2009, 01:03 AM
not too sure you can - though I may be mistaken.

From what I've read, the .NET autocomplete functionality wraps IAutoComplete, which is not a .NET component itself and doesn't expose much of anything.

You'd have to...
A. get down and dirty with the Win32 API
B. use a third party autocomplete component
C. write your own autocomplete (by adding a listbox control when the user starts typing, populating it with the appropriate strings based on what they've typed so far, and deleting that control when done).
D. live with the default height. The user -can- resize it, and it will remain that size until you no longer use the dialog.

SECC0
03-28-2009, 01:11 AM
:) thanks man

I already have my custom autocomplete function :wip: .. just trying to use more .net abilities.
But I have a choice.. it's good.

Thanks again for the very fast reply.

CGTalk Moderation
03-28-2009, 01:12 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.