Collectives on Stack Overflow. Learn more. Forms Ask Question. Asked 11 years, 8 months ago. Active 11 years, 7 months ago. Viewed 1k times. Did I miss to include something? Improve this question. Community Bot 1 1 1 silver badge.
NET Blog. Filed under: c Tags: feature , intellisense , textbox , Windows Forms Recently I came across a problem of implementing a intellisense kind of feature in a normal text box in which the user will type some text in a textbox and keep getting intellisense help to complete the current word.
Basically it was typing of TableName and corresponding columns. You require a ListBox Control to put all your items used for word completion. You require a method to get the point Co-ordinates of the current text being typed in the TextBox. FromHwnd textBoxControl.
MeasureString textBoxControl. Substring 0, textBoxControl. SelectionStart , textBoxControl. ContextChoiceItemSelected ' Gets the selected item. Text End Sub. DisplayText ' Gets the text to be inserted. InsertText ' Gets the item selected. CloseContextChoice ;. CloseContextChoice End Sub. BindToCommand Keys. Control Keys. L , "Editor. ContextChoice" ;. Red ;. Size , ;. Size , DodgerBlue ;. Green ;. Bold ;. AddPrompt "Control.
Add string text, string tooltipText, int imageIndex, int selectedImageIndex " , "Specify the text of the item, its tooltip text, image index and selected image index" ; e. Add string text, string tooltipText, int imageIndex " , "Specify the text of the item, its tooltip text, and image index" ; e. Add string text, string tooltipText, int imageIndex, int selectedImageIndex " , "Specify the text of the item, its tooltip text, image index and selected image index" e.
Add string text, string tooltipText, int imageIndex " , "Specify the text of the item, its tooltip text, and image index" e. Add string text, string tooltipText " , "Specify the text of the item, and its tooltip text" End Sub.
GetLine this. Text ; e. CancelEventArgs Handles editControl1. GetLine Me. CurrentLine ' Gets the index of the current word in that line. LineLexems ind - 1 ' If the count is less than '2', do not show the Context Prompt popup.
If lexemLine. If lex. Text e. ContextPrompt sender , Syncfusion. Make a new project, set "C allplatforms allprojecttypes" and search forms framework. Does your new project dialog look like mine: i. Show 5 more comments. Active Oldest Votes. Add a comment. Danial Sa'adati Danial Sa'adati 53 11 11 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.
0コメント