In the submitted code the autocomplete ProcessAutoComplete method generates the exception below when the TextBox doesn’t have focus. In project sample you can recreate the exception by pressing the form button you can avoid the exception by uncomment the row 18 of the files form1.cs (set the focus first).
Is their a way to call autoComplete.ProcessAutoComplete method without having the focus on the field?
What mean the exception generated?
Exception generated:
System.ArgumentNullException was unhandled
Message="Key cannot be null.\rParameter name: key"
Source="Syncfusion.Tools.Windows"
ParamName="key"
StackTrace:
at Syncfusion.Windows.Forms.Tools.AutoComplete.GetControlAutoMode()
at Syncfusion.Windows.Forms.Tools.AutoComplete.ProcessAutoComplete(String currentText, String selectedEntry, Point location)
at Syncfusion.Windows.Forms.Tools.AutoComplete.ProcessAutoComplete(String currentText)
at WindowsApplication1.AutoCompleteTextBox.ShowAutoComplete() in C:etSamples\AutocompleteBug\WindowsApplication1\AutoCompleteTextBox.cs:line 42
at WindowsApplication1.Form1.button1_Click(Object sender, EventArgs e) in C:etSamples\AutocompleteBug\WindowsApplication1\Form1.cs:line 19
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsApplication1.Program.Main() in C:etSamples\AutocompleteBug\WindowsApplication1\Program.cs:line 14
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
AutocompleteBug.zip