Telerik RadDropDownList loses focus when searching an item by pressing a key that is a label shortcut - vb.net

I have many controls in a panel. One is a System.Windows.Forms.Label next to a text box, and another control is a Telerik.WinControls.UI.RadDropDownList.
The dropdown list has two items: True and False.
The label has a Text value of "%Type" (so a shortcut there).
When the dropdown list is focused and you press F, the False item gets selected, which is good. But if you press T, without the ALT key down, the focus jumps because of the label shortcut and the text box gets the focus.
Has anyone experienced this behavior or have any idea on how to work around this?
I noticed that the KeyDown event of the dropdown list is being triggered when pressing T but not the KeyUp or KeyPress event. Also, as soon as I remove the & from the label text, everything works fine.
Thanks!

Related

How can I remove keyboard focus from a button on User Control after clicking it, in a vb.net PowerPoint add-in?

I have a vsto add-in for PowerPoint (vb.net) which includes a User Control with several buttons.
After clicking any of those buttons, or the User Control itself, I can't immediately use 'Ctrl' keyboard shortcuts, like Ctrl+C. It seems that the button or the User Control gets the focus. If I click on the slide, 'Ctrl' keyboard shortcuts work again.
Is there a way that I can take the focus away from the Button / User Control, in my Button1.Click event handler, in order to be able to use Ctrl+C right away? Or a way in which I can place the focus on the PPT Presentation?
I have searched and tried a ton of different methods, with no success...
PS: One observation I have made is that if instead of a Button, I click a Panel within my User Control, I do not have this problem.
Another observation is that while I can't use 'Ctrl' shortcuts right after clicking the button, 'Alt' shortcuts continue working fine.

Program does not tab through controls in the correct order

I have a form with a button which adds text boxes in addition to the 8 text boxes already on the form which are named Textbox1 through 8. When I launch the application and enter the first textbox, I can tab through all the way from 1 - 8.
When I click my button it programmatically creates a textbox below the last textbox with appropriate name such as Textbox9 for the ninth, Textbox10 for the tenth etc.
However when a textbox is added via the button, tabbing through the controls skips from the eighth, to any buttons on the form, and then to the created textbox. Any idea why this happens and how I can resolve it? I've tried google to no avail. Please let me know if you need any code, thank you.
Thanks to Daniel Cook and Grim, I solved my issue by setting the tabindex to match the textbox number, however I also found that setting TabStop to false on the buttons and controls helped me to keep the tab focus within the text boxes.

DevExpress VerticalGrid Validate event and behavior with RadioButton cell editors

I'm using the VerticalGrid in MultiRecordView. Its Validate event fires when the grid detects that a record that has been changed is losing focus. I'm writing data to the database from this event.
My users want to use the keyboard left/right arrow keys to move forwards and backwards through the recordset, so I trap those keys and set the FocusedRecord accordingly.
If one of the row editors is a RepositoryItemRadioButton, the Validate event doesn't always fire. The users will click on the radio-button value desired and then, before they click on another row in the record, they'll hit the arrow key to move to the next record. The change to the radio button group has not been detected by the grid in that sequence of events.
The radio button change is detected only when the button loses focus.
Is there a way to cause the vertical grid to recognize that a radio button editor has been changed and fire the Validate event, if the user doesn't give another row in the record the focus?
I thought EditValueChangedFiringMode property controlled that behavior, but setting it to Default or to Buffered does not have the desired effect.
Thanks

Default Button on Form (VB 2008)

I want to find a way to make a specific button, the form's default button,
I.e. the button that is highlighted when the form opens for the first time.
I tried the AcceptButton property but when I run the program, that does not work.
Any idea?
Thank you in advance,
Tassos
You need to change the AcceptButton property of the containing form.
form1.AcceptButton = button1
Here form1 is the Form whose default button you need to set, and button1 is the name of the Button on that form.
The form's AcceptButton and CancelButton properties define the default behaviour for the Enter and Escape keys, rather than the highlighting.
To highlight the button use the Focus method, but when doing this in the form_load event you will need to call the Select method instead.
btnDefault.Select()
As mentioned in the comments, setting the control to the lowest taborder will achieve the same thing
The answer from 'chk' on 5/2/13 is the correct answer, but is shown as a string which of course is not the way to do it.
Also, in the form's property sheet you can find, under Misc, the property 'AcceptButton'. This will give you a list of buttons on the form - just select the one you want.
The button selected as the AcceptButton will behave as the 'default' button. It will be 'highlighted' with a darker border and will be clicked when you push the Enter key on your keyboard.
Setting up an AcceptButton is different than setting the button's focus. The AcceptButton's click event will be triggered by the Enter key no matter which control has the focus on the form.
You can also do this programmatically.
I have a maintenance form where initially I want the "search" button as the form accept button.
when I'm displaying the field maintenance area, I want the "ok" button to be the accept button.
You simply change this in the appropriate areas in your code to Me.AcceptButton = MyButtonName.

detect paste on text box - vb.net

I have a text box and want to know if the data enter into is via pressing numeric keys or via a CTRL+V or via mouse right click.
Do not want to use windows message to process for paste/right click paste event.
You can use the KeyDown event to see whether Ctrl, then V was pressed (in two subsequent events).
You can use the MouseDown event to see whether the right mouse button was pressed.
You can use the KeyDown event to see if numeric keys were pressed.
If you use a flag for these three cases, then check it in the TextChanged event, you can determine where the text likely came from.