Highlighted
Absent Member.
Absent Member.
1431 views

Autocomplete function

[Migrated content. Thread originally posted on 26 October 2011]

Hello,

"I would like to be able to put a TextBox/Entry-Field with autocomplete on a form. I thought I would be able to do it by placing the .NET TextBox control on my form, but although I can get the TextBox to appear, and I set the properties to make it autocomplete, it doesn't seem to be working. Has anyone successfully done something like this? I created a .NET DEF file using netdefgen and System.Windows.Forms.dll".

This is a text from an old post. I am trying to get this to work aswell but I can't figure out how to fill the forms.XML file which holds the information for the autocomplete function.

Can someone help me get this to work.
Thanks,

Andre,
0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Autocomplete function

I do not have any experience with this control or how forms.XML file works, but if you post the code you have made, others may be able to help.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Autocomplete function

Let me clarify.

I have a file which holds client names and I want a textbox using autocomplete which will show in the droplist the results after type the first charachter. (typing 'a' will show 'Andre', 'Jansen' etc.)

In my code:
MODIFY TEXTBOX-HANDLE "set_AutoCompleteMode"(
@AutoCompleteMode_SuggestAppend)
GIVING RTN-CODE.
MODIFY TEXTBOX-HANDLE "set_AutoCompleteSource"(
@AutoCompleteSource_CustomSource)
GIVING RTN-CODE.

My question is: how do I chain the CustomSource to my external file.

regards,
Andre.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Autocomplete function

This url may be of some help:
http://www.c-sharpcorner.com/UploadFile/mahesh/AutoCompletion02012006113508AM/AutoCompletion.aspx

You can also set these properties at run-time using the following code:

comboBox1.AutoCompleteSource = AutoCompleteSource.AllSystemSources;
comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;

The AutoCompleteSource Enumeration has following members:

AllSystemResources - Specifies the equivalent of FileSystem and AllUrl as the source. This is the default value when AutoCompleteMode has been set to a value other than the default.

•AllUrl - Specifies the equivalent of HistoryList and RecentlyUsedList as the source.
•CustomSource - Specifies strings from a built-in AutoCompleteStringCollection as the source.
•FileSystem - Specifies the file system as the source.
•FileSystemDirectories - Specifies that only directory names and not file names will be automatically completed.
•HistoryList - Includes the Uniform Resource Locators (URLs) in the history list.
•ListItems - Specifies that the items of the ComboBox represent the source.
•None - Specifies that no AutoCompleteSource is currently in use. This is the default value of AutoCompleteSource.
•RecentlyUsedList - Includes the Uniform Resource Locators (URLs) in the list of those URLs most recently used.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Autocomplete function

Thanks but I want to know how to code this in Acucobol.
I don't know how to translate C-code to cobol.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Autocomplete function

// AutoCompleteStringCollection
AutoCompleteStringCollection data = new AutoCompleteStringCollection();
data.Add("Mahesh Chand");
data.Add("Mac Jocky");
data.Add("Millan Peter");
comboBox1.AutoCompleteCustomSource = data;

This is what I am looking for, but I don't know how to translate this.

André.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.