DevExpress RepositoryItemComboBox enter text without showing caret - c#

I am using RepositoryItemComboBox inside a DevExpress.XtraGrid.GridControl. I have very specific requirements for the behavior of the RepositoryItemComboBox. One of these is as follows:
On receiving focus, the combo box should not show caret. It should not highlight (select) the current text.
On keyboard input, the combo box should not show caret, but should update the edit value.
Is it possible to achieve this behavior with RepositoryItemComboBox?

You're probably looking for TextEditStyle = TextEditStyle.DisableTextEditor?

Related

DevExpress MemoExEdit does not show the first line of my text until down arrow pressed

I needed a TextBox in C# UI with the capability of showing the multiline content if needed. Once the down arrow or ellipsis (located at the inner edge of the text box)is pressed, then a dialog pops up and either allows the user to type more text or shows the already saved multiline text.
To that end , after research I found MemoExEdit from DevExpress. Now I have everything I need except the textbox(MemoExEdit) does not show anything until the down arrow is clicked. in other words the text inside the box is blank actually just a blue A shows up regardless of my content. Thanks for any help how to fix this.
I got my answer : Set the MemoExEdit's Properties.ShowIcon property to false.

how to connect two rich text box

I write a word processor, and I want to display the text on separate pages, like Microsoft Word, then I think do Collection of Rich Text Box, and I want that when a user typed in and filled the first box in the text, The cursor moves automatically the second box.
How can I do this? Is there any event activated when the text box is filled?
I found this to build OnVisibleScrollbarsChanged event. http://www.csharp-examples.net/check-scrollbars-visibility/
There are events which trigger when the textbox's text get changed.
So count the amount of text within that box, and if it reaches a certain amount - go to the next 'page'.

How to edit values in a c# listbox

This is more of a UI Design approach on how to let the user edit values in a list box.
I am interested in the Usability issue.
First approach is having a textBox near the list.
When user selects an element in the list, the text goes to the textbox.
My second though is having an input box coming up (a modal) and edit the value there.
Another option is to use a list view and let the user edit inline. This might be tricky if the user doesn't know this is editable (not all user do)
What would you prefer? Any suggestions on a different approach?
I have used data binding to bind text boxes and numeric controls to a listbox. As the list box selection is changed then the relevant data appears in the controls.
Another way is a property grid linked to the current selected item in the list box. That works well for users who may be relatively savvy for the property grid.
As far as I think I would go for your second approach. I would like an edit button. When I select any item in the list box, edit button should be enabled. When I click edit a small modal dialog saying ok or cancel and in textbox displaying the current value which I can edit.
I think a list view looks a lot cleaner, and people are getting more used to this kind of thing as more web pages use client-side script, Ajax, etc.
I don't like the idea of a modal popup - very clunky.
I did this recently using a hidden text box that I would show positioned over the list box item populated with the selected item text when the user double clicked or pressed F2. When the user pressed enter or the text box lost focus, the text box was hidden and the list box item text was replaced with the edit box text. If the user pressed escape, the text box was hidden and the list item text remained unchanged (i.e cancel).

Cursor not showing when combobox is dropped down

I have an application where I have a product search text field. To implement a predictive text like feature, I hid a combo box behind the text box that populates with the appropriate products. That all works fine and dandy. The problem is the cursor does not show on the form while the combo box is dropped. I can still use the cursor to select the results from the combo box, but it is invisible until I click something on the form.
ComboBox AutoComplete Custom Capabilities
See this accepted answer to this question. Combo box already has an AutoComplete mode. No reason to hide it behind a textbox.
Bring the cursor back with:
Cursor.Current = Cursors.Default;
Do you have the combobox dropdown style as DropDownList?
Also why not use the AutoComplete Mode to accomplish predictive text feature
http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(SYSTEM.WINDOWS.FORMS.COMBOBOX.AUTOCOMPLETEMODE);k(SYSTEM.WINDOWS.FORMS.COMBOBOX);k(VS.PROPERTIES);k(TargetFrameworkMoniker-%22.NETFRAMEWORK%2cVERSION%3dV3.5%22)&rd=true

Getting handle of Autocomplete dropdown box of textbox in winforms

I wanted to adjust the width of the Autocomplete dropdown box of a textbox. I dont want to adjust the width of that textbox, but only Autocomplete dropdown. I know that there is no way I can increase the width of the Autocomplete dropdown by using properties provided with textbox.
Hence I wanted to know whether there is any way to get the handle of that Autocomplete box and then increase the width of that drop downlist without changing the textbox width?
If this is not possible then I would like to create my custom textbox with autocomplete, in this case how to use the existing autocomplete functionality provided by microsoft? Is there any way to do it. Are there any libraries available for this?
I don't think you can use Microsoft's implementation of autocomplete, which does not have an option to adjust dropdown width.
Create a background thread to not get into the way of typing, and hook up the text change event of a combobox box or a textbox to update the candidate list (assuming autosuggest mode since you mention a dropdown). You can probably add/remove the combobox items on the fly if you have a combobox. But for dropdown list and textbox items you need a popup window
It is easy to get a popup to show, but you need to not use a fixed position so it won't go off the screen when the textbox is close to the edge of the screen. And the focus logic is a little bit complex. you need to keep focus on the textbox unless the user press the arrow keys to make a selection.
so
when focus is on textbox:
arrow keys move the focus to the popup
other keys goes to the textbox, if not handled by the dialog itself, except for the delete key when mouse is over the popup.
when focus is on popup:
arrow keys move the focus to the sibling candidate item or the textbox
other keys goes to the textbox, if not handled by the dialog itself, except for the delete key
mouse clicks:
dismiss the popup outside of the popup or the popup.
update the value of textbox if a candidate item in the popup is clicked on
It takes a lot of effort to get the focus/threading right. If you can afford some form space, you can just add a fixed width listbox to the form instead, like Visual Studio help viewer's index pane.
After going through lot of blog posts and different articles, I came to a consensus that it is next to impossible to get a solution to my problem in the way I wanted. So I've decided either to come up with a custom solution or as Sheng Jiang said I need to implement my own autocomplete object.
I've come up with a solution which fits my requirement by increasing the width of the textbox as per the largest string in the autocomplete string list while I'm adding the autocomplete custom source. As I said I cant increase the width of the text box because of the size constraint on the form, so I decided to keep this textbox in a panel and increase the size of the textbox inside that. Panel will not grow with the textbox so that solved my problem.
I know this is not perfect solution but it fits my requirement.

Categories