.Net textBox AutoCompleteMode (help)

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  03 March 2009
.Net textBox AutoCompleteMode (help)

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

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
  03 March 2009
short: yes

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
  03 March 2009
Wow, it works..

Very simple and very cool
  03 March 2009
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. )
  03 March 2009
Yes, you're right.. thanks again
  03 March 2009

How can I increase the autocomplete list height? It's too small by default..
I've read .net help on microsoft site , but I'm not shure which property I have to use in this case..

Attached Images
File Type: jpg Untitled-1.jpg (11.6 KB, 12 views)
  03 March 2009
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.
  03 March 2009
thanks man

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

Thanks again for the very fast reply.
  03 March 2009
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 04:50 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.